Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
Nagios Plugin for monitoring Cisco UCS rack and blade center hardware via XML API.
Current Version
0.6
Last Release Date
2017-07-19
Owner
Herwig Grimm
Download URL
http://vs241041.vserver.de/dl/check_cisco_ucs_v0.6/check_cisco_ucs.go
License
GPL
Compatible With
source file: check_cisco_ucs.go<br> Version 0.6 (19.07.2017)<br> <br> check_cisco_ucs is a Nagios plugin to monitor Cisco UCS rack and blade center hardware.<br> <br> The plugin uses the Cisco UCS XML API via HTTPS to do a wide variety of checks.<br> <br> It uses the Google Go progamming language because of no need to install any libraries.<br> <br> For Go installation instructions see http://golang.org/doc/install<br> <br>
64 bit binary version can be found at: <br> <a href="http://vs241041.vserver.de/dl/check_cisco_ucs_v0.6/amd64/check_cisco_ucs">http://vs241041.vserver.de/dl/check_cisco_ucs_v0.6/amd64/check_cisco_ucs</a><br> <br>
<br> This nagios plugin is free software, and comes with ABSOLUTELY NO WARRANTY.<br> 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).<br> <br> tested with:<br> 1. UCSC-C240-M3S server and CIMC firmware version 1.5(1f).24<br> 2. Cisco UCS Manager version 2.1(1e) and UCSB-B22-M3 blade center<br> 3. Cisco UCS Manager version 2.2(1b) and UCSB-B200-M3<br> 4. UCSC-C220-M4S server and CIMC firmware version 2.0(4c).36<br> 5. UCS C240 M4S and CIMC firmware version 3.0(3a)<br> <br> see also:<br> Cisco UCS Rack-Mount Servers Cisco IMC XML API Programmer's Guide, Release 3.0<br> <a href="http://www.cisco.com/c/en/us/td/docs/unified_computing/ucs/c/sw/api/3_0/b_Cisco_IMC_api_301.html">http://www.cisco.com/c/en/us/td/docs/unified_computing/ucs/c/sw/api/3_0/b_Cisco_IMC_api_301.html</a><br> <br> changelog:<br> Version 0.1 (11.06.2013) initial release<br> <br> Version 0.2 (26.06.2013)<br> usage text debug flag added,<br> write errors to stdout instead of stderr,<br> flag -E to show environment variables added<br> flag -V to print plugin version added<br> <br> Version 0.3 (24.04.2014)<br> flag -z *OK if zero instances* added<br> <br> Version 0.4 (24.02.2015)<br> flag -F display only faults in output, newlines between objects in output line<br> <br> Version 0.5 (19.05.2015) fix for: "remote error: handshake failure" see: TLSClientConfig ... MaxVersion: tls.VersionTLS11, ...<br> <br> Version 0.6 (19.07.2017)<br> fix for: " Post https://<ipaddr>/nuova/: read tcp <ipaddr>:443: connection reset by peer"<br> see: TLSClientConfig ... MaxVersion: tls.VersionTLS12, ...<br> <br> flag -M *max TLS Version* added.<br> CIMC firmware version 3.0 needs flag -M 1.2<br> <br> fix for: "HTTP 403 Forbidden error"<br> error in URL path: no backslash after *nuova*<br> see code line: url := "https://" + ipAddr + "/nuova"<br> old: .../nuova/ new: .../nuova<br> <br> todo:<br> 1. better error handling<br> 2. add performance data support<br> 3. command line flag to influence TLS cert verification<br> <br> usage:<br> -H <ip_addr> CIMC IP address or Cisco UCS Manager IP address<br> -t <query_type> query type 'dn' or 'class'<br> -q <dn_or_class> XML API object class name, examples: storageVirtualDrive or storageLocalDisk or storageControllerProps Distinguished Name (DN) name, examples: "sys/rack-unit-1"<br> -o <object> if XML API object class name, examples: storageVirtualDrive or storageLocalDisk or storageControllerProp<br> -s <hierarchical> true or false. If true, the inHierarchical argument returns all child objects<br> -a <attributes> space separated list of XML attributes for display in nagios output and match against *expect* string<br> -e <expect_string> regular expression expect string, ok if this is found, examples: "Optimal" or "Good" or "Optimal|Good"<br> -u <username> XML API username<br> -p <password> XML API password<br> -d <level> print debug, level: 1 errors only, 2 warnings and 3 informational messages<br> -E print environment variables for debug purpose<br> -V print plugin version<br> -z true or false. if set to true the check will return OK status if zero instances where found. Default is false.<br> -F display only faults in output<br> -M <tls_verson> max TLS version, default: 1.1, alternative: 1.2<br> <br> usage examples:<br> <br> Cisco UCS rack server via CIMC:<br>
<pre> $ ./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)
</pre>
Cisco UCS Manager:<br>
<pre> $ ./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) </pre>
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
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.
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.
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?
You must be logged in to submit a review.
To:
From: