Posts tagged SNMP
HP OV NNM 9i Incident Configuration Action – Blat
7I thought I would share command line (action I )came up with for having HP Open View NNM send email notifications based on the various SNMP traps received by the management station.
blat.exe -server smtp.acme.org -to Alert@acme.org -cc HelpDesk@acme.org -html -subject "HPOV: UPS on battery ($snn)" -body "<html><body><p style=font-family:Verdana;font-size:12px;font-style:normal;font-weight:normal;><b>HP Open View NNM Alarm Incident Report</b><br /><br />||<b>Date:</b> %date% %time% ($fot)<br />|<b>Alarm:</b> UPS on battery - power failure($name)<br />|<b>Node:</b> $snn($sln)<br />|<b>IP:</b> $mga ($oma)<br />|<b>Contact:</b> $sct<br />|<b>Location:</b> $slc<br /><br />|<b>Notes:</b> generated by HP Open View NNM 9i management server.<br /></p>|</body></html>"
The command line above will utilize blat to send an HTML formatted email message to alert@acme.org with a copy to helpdesk@acme.org with the body looking something similar to the figure to the figure to the right. I’ve sanitized the screenshot to protect the organization I’m currently employed with. The example above is for the SNMP trap ‘upsOnBattery’ while the image to the right is an example of the SNMP trap ‘powerRestored’. You’ll notice the | in the command line is interpreted as a CR/LF by NNM. Here are some of the parameters used in the above example;
- $ssn – node name of the object sending the SNMP trap
- $fot – first occurence time
- $name – OID name of the trap received
- $sln – DNS name of the node
- $mga – management IP address
- $oma – alternative management IP address
- $sct – contact information for the object as stored in sysContact.0
- $slc – location information for the object as stored in sysLocation.0
While it wasn’t too hard it did take some time to get all the formatting down and get it working reliably.
Cheers!
Avaya SNMP MIBs and HP Open View NNM 9i
1
I’ve been working on configuring a new HP Open View Network Node Manager 9i installation on Windows 2008 this week, installing all the SNMP MIBS and migrating all the trapd.conf information from the old Network Node Manager 6.4 install.
I came across an interesting error today trying to load all the Avaya (formerly Nortel) RAPID-CITY SNMP MIBs. I manually copied all the SNMP MIBs from the 6.2 software release for the Avaya Ethernet Routing Switch 5000 series up to the proper directory, in my case it was D:\ProgramData\HP\HP BTO Software\shared\nnm\user-snmp-mibs\. As a side note “Rapid City” was the development codename for the Ethernet Routing Switch 8600.
I originally tried to load the SNMP MIB from the web GUI but it would continually timeout so I took to the command line interface and issued the following command from a command prompt on the server;
nnmloadmib.ovpl -load "D:\ProgramData\HP\HP BTO Software\shared\nnm\user-snmp-mibs\RC-ERROR-MIB.mib"
I received the following error message from that command;
Error execution program: Error detected while loading MIB File: D:\ProgramData\HP\HP BTO Software\shared\nnm\user-snmp-m
-MIB.mib.
This MIB cannot be loaded until the following problem is corrected:
[RC-ERROR-MIB] - Line 2418: Warning: token longer than allowed maximum, truncating
[RC-ERROR-MIB] - Line 2419: Warning: token longer than allowed maximum, truncating
[RC-ERROR-MIB] - Line 2419: Error defining enumerated type: Missing ')' in 'cannotSetPt2PtOrSpokeTypeWithoutRemoteUniWhi
bled(707'
Accepted syntax for enumerated list:
{ label1(value) [ , label2(value) ... ] }
Examples:
{ other(1), invalid(2), direct(3), indirect(4) }[RC-ERROR-MIB] - Line 2419: Error defining OBJECT-TYPE: last token 'ca
OrSpokeTypeWithoutRemoteUniWhileEndptIsEnabled(707'
Accepted syntax for OBJECT-TYPE:
object-label OBJECT-TYPE
SYNTAX type
[ UNITS "text" ]
MAX-ACCESS read-only | read-write | read-create | not-accessible
STATUS current | obsolete | deprecated
[ DESCRIPTION "text" ]
[ REFERENCE "text" ]
[ INDEX { variable ... } ]
[ DEFVAL { value } ]
::= { parentlabel subid }
Example:
sysUpTime OBJECT-TYPE
SYNTAX TimeTicks
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The time (in hundredths of a second) since the
network management portion of the system was last
re-initialized."
::= { system 3 }It turns out that HP Open View NNM doesn’t like tokens that are longer than 60 characters so I had to edit the RC-ERROR-MIB file so that every token was 60 characters or less. If you don’t feel like doing that yourself you can download the file I edited right here, RC-ERROR-MIB
I also had to edit RC-IP-BGP-MIB to fix a different error;
D:\>nnmloadmib.ovpl -load "D:\ProgramData\HP\HP BTO Software\shared\nnm\user-snmp-mibs\RC-IP-BGP.mib"
Error execution program: nnmloadmib: Load file, D:\ProgramData\HP\HP BTO Software\shared\nnm\user-snmp-mibs\RC-IP-BGP.mib,
exist.
D:\>nnmloadmib.ovpl -load "D:\ProgramData\HP\HP BTO Software\shared\nnm\user-snmp-mibs\RC-IP-BGP-MIB.mib"
Error execution program: Error detected while loading MIB File: D:\ProgramData\HP\HP BTO Software\shared\nnm\user-snmp-mib
P-MIB.mib.
This MIB cannot be loaded until the following problem is corrected:
[RC-IP-BGP-MIB] - Line 1529: Error defining OBJECT-TYPE: Expected '::=', found 'The'
Accepted syntax for OBJECT-TYPE:
object-label OBJECT-TYPE
SYNTAX type
[ UNITS "text" ]
MAX-ACCESS read-only | read-write | read-create | not-accessible
STATUS current | obsolete | deprecated
[ DESCRIPTION "text" ]
[ REFERENCE "text" ]
[ INDEX { variable ... } ]
[ DEFVAL { value } ]
::= { parentlabel subid }
Example:
sysUpTime OBJECT-TYPE
SYNTAX TimeTicks
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The time (in hundredths of a second) since the
network management portion of the system was last
re-initialized."
::= { system 3 }The fix was to tweak the description used on line 1508, DESCRIPTION “————–”. I replaced it with, DESCRIPTION “Why does this choke within NNM”. If you don’t care to hack the MIB yourself, you can download a fixed copy from here, RC-IP-BGP-MIB
Cheers!
Cisco Nexus Switch Backups with Perl SNMP
24
I’ve spent some time over the past few days trying to get our home grown Perl script designed to backup all our network switches to work with the Cisco Nexus 7010 and 5010 switches.
With previous Cisco switches such as the 6509, 3750, 2960, etc we know that the following commands (when sent via a Perl script using the Net-SNMP Perl module) would instruct the switch to copy it’s running-config to a TFTP server.
snmpset -v1 -c$COMMUNITY $HOST ccCopyProtocol.$RANDOM i 1 snmpset -v1 -c$COMMUNITY $HOST ccCopySourceFileType.$RANDOM i 4 snmpset -v1 -c$COMMUNITY $HOST ccCopyDestFileType.$RANDOM i 1 snmpset -v1 -c$COMMUNITY $HOST ccCopyServerAddress.$RANDOM a "10.1.1.50" snmpset -v1 -c$COMMUNITY $HOST ccCopyFileName.$RANDOM s "sw-train-acme.cfg" snmpset -v1 -c$COMMUNITY $HOST ccCopyEntryRowStatus.$RANDOM i 1 sleep 5 snmpget -v1 -c$COMMUNITY $HOST ccCopyState.$RANDOM #if not successful sleep 3 and re-check ccCopyState else continue and destroy table entry snmpset -v1 -c$COMMUNITY $HOST ccCopyEntryRowStatus.$RANDOM i 6
I know that the both the Cisco Nexus 7010 and 5010 both balk at the SNMP OIDS/MIBS used above. So I’m searching for a set of equivalent SNMP OIDS/MIBS as those in CISCO-CONFIG-COPY-MIB for NX-OS. I’m not sure that such a OID/MIB even exists for NX-OS but it doesn’t hurt to search and ask.
I’m curious if anyone else has come across this issue? I know that there is an XML interface available but I would prefer to keep using the PERL/SNMP script that I’ve already developed. In the interim I’ll probably write an Expect script (or add some Expect code to my existing Perl script) to remotely connect to the switches and issue the appropriate copy commands.
Cheers!
Updated: Monday June 27, 2011
I’ve finally found the issue and now I’m able to backup the Cisco Nexus switches as expected.

