File no_printf.patch of Package nagios-plugins-ups_alarm

Index: check_ups_alarm.pl
===================================================================
--- check_ups_alarm.pl.orig
+++ check_ups_alarm.pl
@@ -100,7 +100,7 @@ sub get_snmp_ups($){
 
 	# Query the UPS
 	if (!defined($response = $session->get_request($OID))){
-		printf STDERR $session->error();
+		print STDERR $session->error();
 	
 		$session->close();
 		nagios_exit "UNKNOWN";
@@ -262,7 +262,7 @@ sub get_nagios_status($$$$;$$){
 		$nagios_message = "UPS State UNKNOWN.  Please check the command line syntax";
 	}
 
-	printf "$nagios_message\n";
+	print "$nagios_message\n";
 	nagios_exit "$nagstatus";
 
 }
@@ -296,26 +296,26 @@ sub check_action($){
 
 sub show_help(){
 	
-	printf "scriptname [options]\n";
-	printf "       	-C\tSNMP Community\n";
-	printf "       	-H\tHostname\n";
-	printf "       	-P\tSNMP Port\n";
-	printf "	-T\tSNMP Timeout\n";
-	printf "	-w\tWarning Threshold\n";
-	printf "	-c\tCritical Threshold\n";
-	printf "	-X\tType of Check (see below)\n\n";
-	printf "Check Types:\n";
-	printf "   batteryStatus	Current Status of the Battery [UNKNOWN,NORMAL,LOW,DEPLETED]\n";
-	printf "   batteryMinRemaining	Estimated minutes of battery life remaining (65535 means we aren't on battery power)\n";
-	printf "   batterySeconds	Number of seconds we've been on battery power (0 means we aren't on battery power)\n";
-	printf "   batteryTemperature	Current temperature (degrees Farenheit)\n";
-	printf "        -k\tLower Warning Threshold\n";
-	printf "	-r\tLower Critical Threshold\n";
-	printf "   inputLineBads	Counter showing how many times the input has been out of spec\n";
-	printf "   outputLoadPercent	Percentage of the current load of the Data Center compared to the capacity of the UPS\n";
-	printf "   alarmCount		Current number of alarms on the UPS\n";
-	printf "\nNote:\n";
-	printf "     The Warning and Critical Thresholds should always be set UNLESS batteryStatus is selected\n";
+	print "scriptname [options]\n";
+	print "       	-C\tSNMP Community\n";
+	print "       	-H\tHostname\n";
+	print "       	-P\tSNMP Port\n";
+	print "	-T\tSNMP Timeout\n";
+	print "	-w\tWarning Threshold\n";
+	print "	-c\tCritical Threshold\n";
+	print "	-X\tType of Check (see below)\n\n";
+	print "Check Types:\n";
+	print "   batteryStatus	Current Status of the Battery [UNKNOWN,NORMAL,LOW,DEPLETED]\n";
+	print "   batteryMinRemaining	Estimated minutes of battery life remaining (65535 means we aren't on battery power)\n";
+	print "   batterySeconds	Number of seconds we've been on battery power (0 means we aren't on battery power)\n";
+	print "   batteryTemperature	Current temperature (degrees Farenheit)\n";
+	print "        -k\tLower Warning Threshold\n";
+	print "	-r\tLower Critical Threshold\n";
+	print "   inputLineBads	Counter showing how many times the input has been out of spec\n";
+	print "   outputLoadPercent	Percentage of the current load of the Data Center compared to the capacity of the UPS\n";
+	print "   alarmCount		Current number of alarms on the UPS\n";
+	print "\nNote:\n";
+	print "     The Warning and Critical Thresholds should always be set UNLESS batteryStatus is selected\n";
 	nagios_exit "UNKNOWN";
 }
 
@@ -350,7 +350,7 @@ if ($action ne "ERROR"){
 	$current_oid = $snmp_ups{"$action"};
 	$current_status = get_snmp_ups "$current_oid";
 } else {
-	printf "Unknown action (-X) type!\n";
+	print "Unknown action (-X) type!\n";
 	show_help;
 }
 
openSUSE Build Service is sponsored by