Search Exchange

Search All Sites

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

Directory Tree

Cisco UCS XML API

Rating
13 votes
Favoured:
0
Current Version
0.6
Last Release Date
2017-07-19
Compatible With
  • Nagios 3.x
  • Nagios 4.x
License
GPL
Hits
71630
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Nagios Plugin for monitoring Cisco UCS rack and blade center hardware via XML API.
source file: check_cisco_ucs.go
Version 0.6 (19.07.2017)

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

64 bit binary version can be found at:
http://vs241041.vserver.de/dl/check_cisco_ucs_v0.6/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
4. UCSC-C220-M4S server and CIMC firmware version 2.0(4c).36
5. UCS C240 M4S and CIMC firmware version 3.0(3a)

see also:
Cisco UCS Rack-Mount Servers Cisco IMC XML API Programmer's Guide, Release 3.0
http://www.cisco.com/c/en/us/td/docs/unified_computing/ucs/c/sw/api/3_0/b_Cisco_IMC_api_301.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.04.2014)
flag -z *OK if zero instances* added

Version 0.4 (24.02.2015)
flag -F display only faults in output, newlines between objects in output line

Version 0.5 (19.05.2015) fix for: "remote error: handshake failure" see: TLSClientConfig ... MaxVersion: tls.VersionTLS11, ...

Version 0.6 (19.07.2017)
fix for: " Post https:///nuova/: read tcp :443: connection reset by peer"
see: TLSClientConfig ... MaxVersion: tls.VersionTLS12, ...

flag -M *max TLS Version* added.
CIMC firmware version 3.0 needs flag -M 1.2

fix for: "HTTP 403 Forbidden error"
error in URL path: no backslash after *nuova*
see code line: url := "https://" + ipAddr + "/nuova"
old: .../nuova/ new: .../nuova

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.
-F display only faults in output
-M max TLS version, default: 1.1, alternative: 1.2

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)

 	$ ./check_cisco_ucs -H 10.1.1.235 -t dn -q sys/rack-unit-1/indicator-led-4 -a "id color name" -e "green" -u admin -p pls_change -o equipmentIndicatorLed -M 1.2
 	OK - Cisco UCS sys/rack-unit-1/indicator-led-4 (id,color,name)
 	4,green,LED_HLTH_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 (6)
bygrayloglearn, November 26, 2020
Hi team,

I am getting the below error could you please suggest

./check_cisco_ucs.go --help
./check_cisco_ucs.go: line 1: //: Is a directory
./check_cisco_ucs.go: line 2: syntax error near unexpected token `('
./check_cisco_ucs.go: line 2: `// Version 0.6 (19.07.2017)'


[root@ittestnagiosxi test]# ./check_cisco_ucs.go --help
./check_cisco_ucs.go: line 1: //: Is a directory
./check_cisco_ucs.go: line 2: syntax error near unexpected token `('
./check_cisco_ucs.go: line 2: `// Version 0.9 (11.06.2019)
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?