Search Exchange

Search All Sites

Nagios Log Server Now Available - Download Now

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Cisco UCS XML API

Bookmark and Share

Rating
11 votes
Favoured:
0
Current Version
0.3
Last Release Date
2014-04-24
Compatible With
  • Nagios 3.x
E-mail
License
GPL
Hits
38321
Nagios Plugin for monitoring Cisco UCS rack and blade center hardware via XML API.
source file: check_cisco_ucs.go
Version 0.3 (24.4.2014)

check_cisco_ucs is a Nagios plugin to monitor Cisco UCS rack and blade center hardware.

The plugin uses the Cisco UCS XML API via HTTPS to do a wide variety of checks.

It uses the Google Go progamming language because of no need to install any libraries.

For Go installation instructions see http://golang.org/doc/install

32 bit binary version can be found at:
http://vs241041.vserver.de/dl/check_cisco_ucs_v0.3/386/check_cisco_ucs
The binary was compiled with Go 1.3 on CentOS 6.5 2.6.32 i386

64 bit binary version can be found at:
http://vs241041.vserver.de/dl/check_cisco_ucs_v0.3/amd64/check_cisco_ucs


This nagios plugin is free software, and comes with ABSOLUTELY NO WARRANTY.
It may be used, redistributed and/or modified under the terms of the GNU General Public Licence (see http://www.fsf.org/licensing/licenses/gpl.txt).

tested with:
1. UCSC-C240-M3S server and CIMC firmware version 1.5(1f).24
2. Cisco UCS Manager version 2.1(1e) and UCSB-B22-M3 blade center
3. Cisco UCS Manager version 2.2(1b) and UCSB-B200-M3

see also:
Cisco UCS Rack-Mount Servers CIMC XML API Programmer's Guide http://www.cisco.com/en/US/docs/unified_computing/ucs/c/sw/api/b_cimc_api_book.html

changelog:
Version 0.1 (11.06.2013) initial release

Version 0.2 (26.06.2013)
usage text debug flag added,
write errors to stdout instead of stderr,
flag -E to show environment variables added
flag -V to print plugin version added

Version 0.3 (24.4.2014)
flag -z *OK if zero instances* added

todo:
1. better error handling
2. add performance data support
3. command line flag to influence TLS cert verification

usage:
-H CIMC IP address or Cisco UCS Manager IP address
-t query type 'dn' or 'class'
-q XML API object class name, examples: storageVirtualDrive or storageLocalDisk or storageControllerProps Distinguished Name (DN) name, examples: "sys/rack-unit-1"
-o if XML API object class name, examples: storageVirtualDrive or storageLocalDisk or storageControllerProp
-s true or false. If true, the inHierarchical argument returns all child objects
-a space separated list of XML attributes for display in nagios output and match against *expect* string
-e regular expression expect string, ok if this is found, examples: "Optimal" or "Good" or "Optimal|Good"
-u XML API username
-p XML API password
-d print debug, level: 1 errors only, 2 warnings and 3 informational messages
-E print environment variables for debug purpose
-V print plugin version
-z true or false. if set to true the check will return OK status if zero instances where found. Default is false.

usage examples:

Cisco UCS rack server via CIMC:
	$ ./check_cisco_ucs -H 10.0.0.7 -t class -q storageVirtualDrive -a "raidLevel vdStatus health" -e Optimal -u admin -p pls_change
	OK - Cisco UCS storageVirtualDrive (raidLevel,vdStatus,health) RAID 10,Optimal,Good (1 of 1 ok)

	$ ./check_cisco_ucs -H 10.0.0.7 -t class -q storageLocalDisk -a "id pdStatus driveSerialNumber" -e Online -u admin -p pls_change
	OK - Cisco UCS storageLocalDisk (id,pdStatus,driveSerialNumber) 1,Online,7AK3QRVQ 2,Online,7AK3QS1G 3,Online,7AK3RT6A 4,Online,7AK3RT8V (4 of 4 ok)
	
	$ ./check_cisco_ucs -H 10.0.0.7 -t dn -q sys/rack-unit-1/indicator-led-4 -o equipmentIndicatorLed -a "id color name" -e green -u admin -p pls_change
	OK - Cisco UCS sys/rack-unit-1/indicator-led-4 (id,color,name) 4,green,LED_FAN_STATUS (1 of 1 ok)
Cisco UCS Manager:
	$ ./check_cisco_ucs -H 10.0.0.10 -t class -q equipmentPsu -a "id model operState serial" -e operable -u admin -p pls_change
	CRIT - Cisco UCS equipmentPsu (id,model,operState,serial) 1,UCS-PSU-6248UP-AC,operable,POG273271G8 2,UCS-PSU-6248UP-AC,operable,POG2732721D 1,UCS-PSU-6248UP-AC,operable,POG273271C5 2,UCS-PSU-6248UP-AC,operable,POG2732721S 1,UCSB-PSU-2500ACPL,operable,AZS27310FFA 2,UCSB-PSU-2500ACPL,operable,AZS27310FH3 3,UCSB-PSU-2500ACPL,operable,AZS27310FH2 4,,removed (7 of 8 ok)

	$ ./check_cisco_ucs -H 10.0.0.10 -t class -q equipmentPsu -a "id model operState serial" -e operable -u admin -p pls_change
	CRIT - Cisco UCS equipmentPsu (id,model,operState,serial) 1,UCS-PSU-6248UP-AC,operable,POG273271G8 2,UCS-PSU-6248UP-AC,operable,POG2732721D 1,UCS-PSU-6248UP-AC,operable,POG273271C5 2,UCS-PSU-6248UP-AC,operable,POG2732721S 1,UCSB-PSU-2500ACPL,operable,AZS27310FFA 2,UCSB-PSU-2500ACPL,operable,AZS27310FH3 3,UCSB-PSU-2500ACPL,operable,AZS27310FH2 4,,removed (7 of 8 ok)

	$ ./check_cisco_ucs -H 10.0.0.10 -t dn -q sys/switch-B/slot-1/switch-ether/port-1 -o etherPIo -a operState -e up -u admin -p pls_change
	OK - Cisco UCS sys/switch-B/slot-1/switch-ether/port-1 (operState) up (1 of 1 ok)

	$ ./check_cisco_ucs -H 10.0.0.10 -t class -q faultInst -a "code severity ack" -e "cleared,no|cleared,yes|info,no|info,yes|warning,no|warning,yes|yes|^$" -z -u admin -p pls_change
	OK - Cisco UCS faultInst (code,severity,ack) (0 of 0 ok)
Reviews (5)
Check out the plugins released by Cisco.

communities.cisco.com/ucsintegrations
bymunterhuber, November 10, 2013
Plugin works great, but is there any possibility to alert only under the following conditions:
*Faults are Major/Critical
*Faults are unaknowleged

Best regards Michael Unterhuber
This plugin works very well. I had few troubles in the beginning so I contacted the owner/developer and he helped me a lot.

For the issue of working from command line and not working on GUI, I did following:
# go build go build check_cisco_ucs.go
The you will get the binary file check_cisco_ucs in the same folder.
After that move the binary file to the nagios libexec folder. (e.g. /usr/local/nagios/libexec)
Then change the owner and permissions on file check_cisco_ucs:
# chmod 755 check_cisco_ucs
# chown nagios.nagios check_cisco_ucs
Test the new binary at CLI with user nagios:
# su – nagios
$ cd /usr/local/nagios/libexec
$ ./check_cisco_ucs -H 172.18.4.7 -t class -q equipmentPsu -a "id model operability" -e "operable" -u kmp -p password

Finally, I am able to monitor all switch ports and power supply units of cisco UCS 5108.

However, I would like to know what other commands I can use? I don't know where I can find CISCO UCS XML API Object class names or DN (distinguished name).

It would be good if I can monitor other components also but don't know what names these components/parts are called in XML API.
byjjtechtech, June 25, 2013
I have been waiting for a long time for someone to write a check for the cisco rackmount servers. I am glad that I can monitor them very similar to the way I monitor my HP servers. I look forward to any future updates. Thanks Herwig for the support as well since I am new to the Go language.
bycgr11, June 24, 2013
1 of 1 people found this review helpful
Hello,

works great from the command line,

./check_cisco_ucs -H x.x.x.x-t class -q topSystem -a "name address currentTime mode" -e "stand-alone" -u username-p password
OK - Cisco UCS topSystem (name,address,currentTime,mode) ServerName,x.x.x.x,Mon Jun 24 17:29:28 2013
,stand-alone (1 of 1 ok)

When i add as a Nagios service check, i just get status unknown "error: EOF"?? Any ideas?