Package: nagios-plugins Version: 1.4-6 Severity: normal Tags: patch
When specifying -T to check_ups to get the UPS temperature in Celsius, I get the following output: UPS OK - Status=Online Utility=115.9V Batt=100.0% Load=78.6% Temp=27.4C|voltage=115900mV;;;0 battery=100%;;;0;100 load=78%;;;0;100 temp=27degF;;;0 The temperature is correct, but in the perf data section, the units are incorrect. A simple patch to check_ups.c fixes this: --- check_ups.c 2004-12-25 18:17:44.000000000 -0500 +++ check_ups.c.new 2005-07-01 11:57:39.211673645 -0400 @@ -280,11 +280,14 @@ return STATE_CRITICAL; else { supported_options |= UPS_TEMP; + char * tempUnits; if (temp_output_c) { + tempUnits = "degC"; ups_temperature = atof (temp_buffer); asprintf (&message, "%sTemp=%3.1fC", message, ups_temperature); } else { + tempUnits = "degF"; ups_temperature = (atof (temp_buffer) * 1.8) + 32; asprintf (&message, "%sTemp=%3.1fF", message, ups_temperature); } @@ -297,13 +300,13 @@ result = max_state (result, STATE_WARNING); } asprintf (&data, "%s %s", data, - perfdata ("temp", (long)ups_temperature, "degF", + perfdata ("temp", (long)ups_temperature, tempUnits, check_warn, (long)(1000*warning_value), check_crit, (long)(1000*critical_value), TRUE, 0, FALSE, 0)); } else { asprintf (&data, "%s %s", data, - perfdata ("temp", (long)ups_temperature, "degF", + perfdata ("temp", (long)ups_temperature, tempUnits, FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0)); } } -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (500, 'unstable'), (500, 'stable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.10-1-686 Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8) Versions of packages nagios-plugins depends on: ii bind9-host [host] 1:9.3.1-2 Version of 'host' bundled with BIN ii dnsutils 1:9.3.1-2 Clients provided with BIND ii fping 2.4b2-to-ipv6-11 sends ICMP ECHO_REQUEST packets to ii iputils-ping 3:20020927-2 Tools to test the reachability of ii libc6 2.3.2.ds1-22 GNU C Library: Shared libraries an ii libldap2 2.1.30-10 OpenLDAP libraries ii libmysqlclient12 4.0.24-10 mysql database client library ii libnet-snmp-perl 5.0.1-1 Script SNMP connections ii libpq3 1:7.4.8-10 PostgreSQL C client library ii libssl0.9.7 0.9.7g-1 SSL shared libraries ii ntp 1:4.2.0a+stable-8 Network Time Protocol: network uti ii ntp-simple 1:4.2.0a+stable-8 Network Time Protocol: daemon for ii ntpdate 1:4.2.0a+stable-8 The ntpdate client for setting sys ii procps 1:3.2.5-1 /proc file system utilities ii qstat 2.8-1 Command-line tool for querying qua ii radiusclient1 0.3.2-8 /bin/login replacement which uses ii smbclient 3.0.14a-5 a LanManager-like simple client fo ii snmp 5.1.2-6.1 NET SNMP (Simple Network Managemen Versions of packages nagios-plugins recommends: pn nagios-text | nagios <none> (no description available) -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]