Rule not alerting

Rule not alerting
0

#1

Hi All,
I’ve been working on a rule but for whatever reason I cant get it to alert.The rule is a templated state down rule for a metric on a Cisco Nexus. I’m testing on Indeni 6.2.0.18.

I stripped the rule down to the very basic and it can be seen in the screenshot with the steps I took to test it.

Is there something I’m missing or doing wrong? any debug tips? anything else that might be causing it not to alert?

Thanks,
Robert

The Rule:
package com.indeni.server.rules.library.templatebased.cisco

import com.indeni.server.rules.RuleContext
import com.indeni.server.rules.library.StateDownTemplateRule

/**
  *
  */
case class CiscoNexusTestRp(context: RuleContext) extends StateDownTemplateRule(context,
  ruleName = "CiscoNexusTestRp",
  ruleFriendlyName = "Cisco Nexus: Test RP",
  ruleDescription = "indeni alert.",
  metricName = "nexus-test",
  alertIfDown = false,
  alertItemsHeader = "Test Alert",
  alertDescription = "Alert Test.",
  baseRemediationText = "Contact Cisco support.")()

#2

The rule looks good. Can you share the IND script or the environment that you are tested on?


#3

Hi Alon,
I’ve been testing using my local instance of an indeni server, version 6.2.0.18.
The devices I used to test are 192.168.191.11 in the KDLab and my local virtual gns3 nexus.
FYI, there is a ssh issue with the nexus where it doesnt release the connections, so if you cant reach the .11 the sessions might need to be cleared out.


IND script is below.
Let me know if you need more info.
Thanks,
Robert

Simplified script for testing:

#! META
name: nexus-show-nexus-test
description: Nexus show nexus_test
type: monitoring
monitoring_interval: 1 minutes
requires:
    vendor: "cisco"
    os.name: "nxos"

#! COMMENTS
nexus-guestshell-status:
    skip-documentation: true

#! REMOTE::SSH
show clock

#! PARSER::AWK
/:/ {
    writeDoubleMetric("nexus-test", null, "gauge", 300, 1)
}

#4

I test it on 192.168.197.15 and I was able to generate the alert: https://192.168.197.15/#!/alerts/ea1e5465-1801-4637-8b84-1e955c2ade20

If you will connect to the server, you will see that I added the ind script under /usr/share/indeni-knowledge/overwrite/parsers/src and the rule under /usr/share/indeni/rules


#5

Hi Alon,
Thanks for testing. For the most part it looks exactly the same as what I have. The only difference is that my ind script was in /usr/share/indeni-knowledge/overwrite/parsers/src/cisco/nexus.
And that is the only script I have in overwrite directory.

Could there be an issue with my DB being in a bad state or anything else saying not to alert. I’ve retried restarting the server and services many times with no luck.

When you tested, how long did you have to wait for it alert?
Thanks,
Robert