Author: glen Date: Tue Mar 8 00:31:01 2005 GMT
Module: SOURCES Tag: DEVEL
---- Log message:
- adjust sourcecode to catch up MySQL / Nagios API changes
---- Files affected:
SOURCES:
nagios-plugins-contrib-API.patch (NONE -> 1.1.2.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/nagios-plugins-contrib-API.patch
diff -u /dev/null SOURCES/nagios-plugins-contrib-API.patch:1.1.2.1
--- /dev/null Tue Mar 8 01:31:01 2005
+++ SOURCES/nagios-plugins-contrib-API.patch Tue Mar 8 01:30:56 2005
@@ -0,0 +1,105 @@
+diff -u nagios-plugins-1.4/contrib/check_mysql.c
nagios-plugins-1.4-worked/contrib/check_mysql.c
+--- nagios-plugins-1.4/contrib/check_mysql.c 2002-03-01 04:42:56.000000000
+0200
++++ nagios-plugins-1.4-worked/contrib/check_mysql.c 2005-02-08
19:09:33.000000000 +0200
+@@ -56,7 +56,7 @@
+ (user = argv[2]) || (user = NULL);
+ (passwd = argv[3]) || (passwd = NULL);
+
+- if (!(mysql_connect(&mysql,host,user,passwd))) {
++ if (!mysql_real_connect(&mysql,host,user,passwd,NULL,MYSQL_PORT,NULL,0)) {
+ printf("Can't connect to Mysql on Host: %s\n", host);
+ return STATE_CRITICAL;
+ }
+diff -u nagios-plugins-1.4/contrib/check_rbl.c
nagios-plugins-1.4-worked/contrib/check_rbl.c
+--- nagios-plugins-1.4/contrib/check_rbl.c 2004-12-02 02:30:32.000000000
+0200
++++ nagios-plugins-1.4-worked/contrib/check_rbl.c 2005-02-08
19:24:45.000000000 +0200
+@@ -21,7 +21,7 @@
+ #include "popen.h"
+ #include "string.h"
+
+-const char progname = "check_rbl";
++const char *progname = "check_rbl";
+ const char *revision = "$Revision$";
+ //const char *copyright = "2000-2003";
+ //const char *email = "[EMAIL PROTECTED]";
+@@ -58,11 +58,11 @@
+
+ /* build the command to run */
+ if (dns_server) {
+- command_line=ssprintf(command_line,"%s @%s %s.%s",
++ command_line=asprintf(&command_line,"%s @%s %s.%s",
+ PATH_TO_DIG,dns_server,
+ query_address_rev, rbl_name);
+ } else {
+- command_line=ssprintf(command_line,"%s %s.%s",
++ command_line=asprintf(&command_line,"%s %s.%s",
+ PATH_TO_DIG,
+ query_address_rev, rbl_name);
+ }
+@@ -118,7 +118,7 @@
+
+ while (fgets(input_buffer,MAX_INPUT_BUFFER-1,child_stderr)) {
+ /* If we get anything on STDERR, at least set warning */
+- result=error_set(result,STATE_WARNING);
++ result=max_state(result,STATE_WARNING);
+ printf("%s",input_buffer);
+ if (!strcmp(output,""))
+ strcpy(output,1+index(input_buffer,':'));
+@@ -128,7 +128,7 @@
+
+ /* close the pipe */
+ if (spclose(child_process)) {
+- result=error_set(result,STATE_WARNING);
++ result=max_state(result,STATE_WARNING);
+ if (!strcmp(output,""))
+ strcpy(output,"nslookup returned an error status");
+ }
+@@ -313,7 +313,7 @@
+ " -V, --version\n"
+ " Print version information\n\n",
+ DEFAULT_SOCKET_TIMEOUT);
+- support();
++ printf (_(UT_SUPPORT));
+ }
+
+
+diff -u nagios-plugins-1.4/contrib/check_uptime.c
nagios-plugins-1.4-worked/contrib/check_uptime.c
+--- nagios-plugins-1.4/contrib/check_uptime.c 2002-03-01 04:42:56.000000000
+0200
++++ nagios-plugins-1.4-worked/contrib/check_uptime.c 2005-02-08
19:30:19.000000000 +0200
+@@ -26,6 +26,9 @@
+ #include "utils.h"
+ #include "popen.h"
+
++const char *progname = "check_uptime";
++void print_usage(void);
++
+ int main(int argc, char **argv)
+ {
+
+@@ -43,12 +46,7 @@
+
+ if(argc != 2){
+ printf("Incorrect number of arguments supplied\n");
+- printf("\n");
+- print_revision(argv[0],"$Revision$");
+- printf("Copyright (c) 2000 Teresa Ramanan ([EMAIL PROTECTED])\n");
+- printf("\n");
+- printf("Usage: %s <host_address>\n",argv[0]);
+- printf("\n");
++ print_usage();
+ return STATE_UNKNOWN;
+ }
+
+@@ -97,3 +95,12 @@
+ printf("%s%s%s\n",(daytok == NULL)?"":daytok,(daytok ==
NULL)?"":",",hrmintok);
+ return STATE_OK;
+ }
++
++void print_usage(void)
++{
++ print_revision(progname,"$Revision$");
++ printf("Copyright (c) 2000 Teresa Ramanan ([EMAIL PROTECTED])\n");
++ printf("\n");
++ printf("Usage: %s <host_address>\n",progname);
++ printf("\n");
++}
================================================================
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit