From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- web/attachments/202053-check_swap.c.patch | 92 +++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 web/attachments/202053-check_swap.c.patch (limited to 'web/attachments/202053-check_swap.c.patch') diff --git a/web/attachments/202053-check_swap.c.patch b/web/attachments/202053-check_swap.c.patch new file mode 100644 index 0000000..34e6a5d --- /dev/null +++ b/web/attachments/202053-check_swap.c.patch @@ -0,0 +1,92 @@ +*** check_swap.c.orig Fri Oct 20 00:53:28 2006 +--- check_swap.c Tue Nov 7 14:54:35 2006 +*************** +*** 37,42 **** +--- 37,48 ---- + const char *copyright = "2000-2006"; + const char *email = "nagiosplug-devel@lists.sourceforge.net"; + ++ /* required to work correctly on solaris (else gets 'Bad Address' errors) */ ++ /* #ifdef HAVE_SYS_STAT_H - using this one doesnt work on solaris */ ++ #ifdef __sun__ ++ #include ++ #endif ++ + #include "common.h" + #include "popen.h" + #include "utils.h" +*************** +*** 236,257 **** + # ifdef CHECK_SWAP_SWAPCTL_SVR4 + + /* get the number of active swap devices */ +! nswaps=swapctl(SC_GETNSWP, NULL); + + /* initialize swap table + entries */ + tbl=(swaptbl_t*)malloc(sizeof(swaptbl_t)+(sizeof(swapent_t)*nswaps)); + memset(tbl, 0, sizeof(swaptbl_t)+(sizeof(swapent_t)*nswaps)); + tbl->swt_n=nswaps; + for(i=0;iswt_ent[i]; +! ent->ste_path=(char*)malloc(sizeof(char)*MAXPATHLEN); + } + + /* and now, tally 'em up */ + swapctl_res=swapctl(SC_LIST, tbl); + if(swapctl_res < 0){ +! perror(_("swapctl failed: ")); +! result = STATE_WARNING; + } + + for(i=0;i 0) ++ (void)printf("Found %d swap device(s)\n",nswaps); ++ + /* initialize swap table + entries */ + tbl=(swaptbl_t*)malloc(sizeof(swaptbl_t)+(sizeof(swapent_t)*nswaps)); ++ ++ if(tbl==NULL) ++ perror(_(argv[0])), exit(STATE_UNKNOWN); ++ + memset(tbl, 0, sizeof(swaptbl_t)+(sizeof(swapent_t)*nswaps)); + tbl->swt_n=nswaps; + for(i=0;iswt_ent[i].ste_path=(char*)malloc(sizeof(char)*MAXPATHLEN)) == NULL) +! perror(_(argv[0])), exit(STATE_UNKNOWN); + } + + /* and now, tally 'em up */ + swapctl_res=swapctl(SC_LIST, tbl); + if(swapctl_res < 0){ +! perror(_("swapctl failed")), exit(STATE_UNKNOWN); + } + + for(i=0;i