summaryrefslogtreecommitdiffstats
path: root/web/attachments/160015-check_ups--1.28.diff
blob: b86f9bb0aa3b8f123c95b59739737cb52c33c692 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
--- check_ups.c.orig	2005-12-15 17:17:54.000000000 -0500
+++ check_ups.c	2005-12-15 17:22:44.000000000 -0500
@@ -7,6 +7,7 @@
  Copyright (c) 2000 Tom Shields
                2004 Alain Richard <alain.richard@equation.fr>
                2004 Arnaud Quette <arnaud.quette@mgeups.com>
+               2005 Garrett Honeycutt <gh@3gupload.com>
 
  
  This program is free software; you can redistribute it and/or modify
@@ -23,13 +24,11 @@
  along with this program; if not, write to the Free Software
  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
- $Id: check_ups.c,v 1.27 2005/03/04 21:58:40 tonvoon Exp $
- 
 ******************************************************************************/
 
 const char *progname = "check_ups";
-const char *revision = "$Revision: 1.27 $";
-const char *copyright = "2000-2004";
+const char *revision = "$Revision: 1.28 $";
+const char *copyright = "2000-2005";
 const char *email = "nagiosplug-devel@lists.sourceforge.net";
 
 #include "common.h"
@@ -302,9 +301,17 @@
 			                    check_crit, (long)(1000*critical_value),
 			                    TRUE, 0, FALSE, 0));
 		} else {
-			asprintf (&data, "%s %s", data,
-			          perfdata ("temp", (long)ups_temperature, "degF",
-			                    FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
+			/* 2005 garrett honeycutt - small bugfix to print the correct abbreviation */
+			if (temp_output_c) {
+				asprintf (&data, "%s %s", data,
+				          perfdata ("temp", (long)ups_temperature, "degC",
+				                    FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
+			}
+			else {
+				asprintf (&data, "%s %s", data,
+                                          perfdata ("temp", (long)ups_temperature, "degF",
+                                                    FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
+			}
 		}
 	}
 
@@ -588,6 +595,7 @@
 	printf ("Copyright (c) 2000 Tom Shields");
 	printf ("Copyright (c) 2004 Alain Richard <alain.richard@equation.fr>\n");
 	printf ("Copyright (c) 2004 Arnaud Quette <arnaud.quette@mgeups.com>\n");
+	printf ("Copyright (c) 2005 Garrett Honeycutt <gh@3gupload.com>\n");
 	printf (COPYRIGHT, copyright, email);
 
 	printf (_("This plugin tests the UPS service on the specified host.\n\