Re: NNMi 9 Email notifications (607 Views)
Reply
Occasional Advisor
Paul Howlett_2
Posts: 10
Registered: ‎11-11-2005
Message 1 of 6 (706 Views)

NNMi 9 Email notifications

Hi, I'm running NNMi 9 on Linux and am trying to sort out SNMP Incident Actions.
I'd like to have an automatic action of an email sent whenever a node goes down. The email message would need to specify the IP address and or hostname of the Node that is in a down state.
What I have working so far, configured the node down action to run a script that sends an email using Sendmail.
Script is :
echo "Subject:Node $sourceObjectName Down"
The email is generated but I'm not getting the source IP address (I've tried the variable $mga too) all i get in the email is Node Down.
Can anyone help please?
I don't want to have to install Alarmpoint as this will involve installing a database too.
Thanks in advance.
Occasional Advisor
Paul Howlett_2
Posts: 10
Registered: ‎11-11-2005
Message 2 of 6 (706 Views)

Re: NNMi 9 Email notifications

Missed part of the script off, should read;
echo "Subject:Node $sourceObjectName Down" | /usr/sbin/sendmail [email address here]
Trusted Contributor
pleconte
Posts: 74
Registered: ‎01-25-2011
Message 3 of 6 (706 Views)

Re: NNMi 9 Email notifications

Hi Paul,

Try with the following attributes (one of them, it depends if you need short/long Name)

$sourceNodeLongName, $sln
*************************
The fully-qualified DNS name as displayed in the Hostname attribute of the incident's source Node's form.

$sourceNodeName, $snn
***********************
Value from the Name attribute of the incident's source Node's form.

regards,
Philippe
O tempora ! O mores !
Occasional Advisor
Paul Howlett_2
Posts: 10
Registered: ‎11-11-2005
Message 4 of 6 (706 Views)

Re: NNMi 9 Email notifications

Hi Thanks, but tried that-same results. I've moved to using the ciscoConfigMan trap (every time I save the config a trap is fired off which triggers the email action script), so similar script but the node name still isn't being displayed.
I've run nnmtrapdump.ovpl -short -t to see what is coming in:
Trap ciscoConfigMan (.1.3.6.1.4.1.9.9.43.2.0.1)at March 10,2011 8:35:53 AM GMT from 'IP Address here'.
Will NNM treat the IP address as the hostname in this instance?
Thanks again.
Occasional Advisor
Paul Howlett_2
Posts: 10
Registered: ‎11-11-2005
Message 5 of 6 (706 Views)

Re: NNMi 9 Email notifications

Hi, anyone any other suggestions to help with my query?
Thanks in advance.
Occasional Advisor
rodarcqu
Posts: 5
Registered: ‎07-27-2011
Message 6 of 6 (607 Views)

Re: NNMi 9 Email notifications

 

In order to configure an incident to receivie an email notification: 

  • Be sure that Network Node Manager box is configured for sending emails.
  • Any application for sending and receiving email can be used as long as it has a CLI utility

Note: Most UNIX servers have mailx application installed by default, which is used to send quick email messages (i.e., without opening up a full-featured mail user agent).

1. Go to Configuration -> Incident configuration -> Management Events Configuration tab.

2. As an example, open Node Down from the list, then the Actions Configuration tab.

3. In Command Type use: ScriptOrExecutable

4. Add a new command*, using the "Registered" lifecycle state. Here are some examples of commands that could be used:

/usr/bin/mailx -s "$snn - Node Down" user@localhost </dev/null

or

echo "Subject:Node $sourceObjectName Down" | /usr/sbin/sendmail <email ID>

5. Save and Close 

*Note. In the command you may specify several Custom Incident Attributes (CIAs), the list of available CIAs is found in the "Help for Administrators" guide available to download at http://support.openview.hp.com/selfsolve/manuals
In the command example the following CIA is used: $snn. This indicates the name attribute of the incident's source node.

==================================================
==================================================
A couple of mail examples below:

# Example 1 - Simple:
echo "This is the body."| mailx -s "mailx Test1"
jsmith@abc.com

For examples 2 and 3, you can create an script and then call the it from the NNMi command field.

# Example 2 - Using Variables:
SUBJECT="mailx Test2"
EMAIL_ADDRESS="
jsmith@abc.com"
BODY="This is the body of the message."

echo "$BODY" | mailx -s "$SUBJECT" "$EMAIL_ADDRESS"

# Example 3 - Attached File:
SUBJECT="mailx Test3"
EMAIL_ADDRESS="
jsmith@abc.com"
BODY="This is the body of the message."
ATTACHED_FILE="/etc/hosts"

cat "$ATTACHED_FILE" | mailx -s "$SUBJECT" "$EMAIL_ADDRESS

 

http://support.openview.hp.com/selfsolve/document/KM1154783?searchIdentifier=-47af8070%3a138264e3583...


The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.