summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_apt.c4
-rw-r--r--plugins/check_by_ssh.c2
-rw-r--r--plugins/check_dig.c2
-rw-r--r--plugins/check_dns.c2
-rw-r--r--plugins/check_load.c2
-rw-r--r--plugins/check_nagios.c2
-rw-r--r--plugins/check_procs.c2
-rw-r--r--plugins/check_snmp.c2
-rw-r--r--plugins/negate.c2
-rw-r--r--plugins/runcmd.c10
-rw-r--r--plugins/runcmd.h2
11 files changed, 16 insertions, 16 deletions
diff --git a/plugins/check_apt.c b/plugins/check_apt.c
index d7be5750..731aab82 100644
--- a/plugins/check_apt.c
+++ b/plugins/check_apt.c
@@ -252,7 +252,7 @@ int process_arguments (int argc, char **argv) {
252/* run an apt-get upgrade */ 252/* run an apt-get upgrade */
253int run_upgrade(int *pkgcount, int *secpkgcount, char ***pkglist, char ***secpkglist){ 253int run_upgrade(int *pkgcount, int *secpkgcount, char ***pkglist, char ***secpkglist){
254 int i=0, result=STATE_UNKNOWN, regres=0, pc=0, spc=0; 254 int i=0, result=STATE_UNKNOWN, regres=0, pc=0, spc=0;
255 struct output chld_out, chld_err; 255 struct cmd_output chld_out, chld_err;
256 regex_t ireg, ereg, sreg; 256 regex_t ireg, ereg, sreg;
257 char *cmdline=NULL, rerrbuf[64]; 257 char *cmdline=NULL, rerrbuf[64];
258 258
@@ -368,7 +368,7 @@ int run_upgrade(int *pkgcount, int *secpkgcount, char ***pkglist, char ***secpkg
368/* run an apt-get update (needs root) */ 368/* run an apt-get update (needs root) */
369int run_update(void){ 369int run_update(void){
370 int i=0, result=STATE_UNKNOWN; 370 int i=0, result=STATE_UNKNOWN;
371 struct output chld_out, chld_err; 371 struct cmd_output chld_out, chld_err;
372 char *cmdline; 372 char *cmdline;
373 373
374 /* run the upgrade */ 374 /* run the upgrade */
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c
index 39d49070..193657c3 100644
--- a/plugins/check_by_ssh.c
+++ b/plugins/check_by_ssh.c
@@ -70,7 +70,7 @@ main (int argc, char **argv)
70 int i; 70 int i;
71 time_t local_time; 71 time_t local_time;
72 FILE *fp = NULL; 72 FILE *fp = NULL;
73 output chld_out, chld_err; 73 cmd_output chld_out, chld_err;
74 74
75 remotecmd = ""; 75 remotecmd = "";
76 comm_append(SSH_COMMAND); 76 comm_append(SSH_COMMAND);
diff --git a/plugins/check_dig.c b/plugins/check_dig.c
index 5d85ae26..2b8b04dc 100644
--- a/plugins/check_dig.c
+++ b/plugins/check_dig.c
@@ -67,7 +67,7 @@ int
67main (int argc, char **argv) 67main (int argc, char **argv)
68{ 68{
69 char *command_line; 69 char *command_line;
70 output chld_out, chld_err; 70 cmd_output chld_out, chld_err;
71 char *msg = NULL; 71 char *msg = NULL;
72 size_t i; 72 size_t i;
73 char *t; 73 char *t;
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index 9de6caf5..167dc4f4 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -86,7 +86,7 @@ main (int argc, char **argv)
86 long microsec; 86 long microsec;
87 struct timeval tv; 87 struct timeval tv;
88 int parse_address = FALSE; /* This flag scans for Address: but only after Name: */ 88 int parse_address = FALSE; /* This flag scans for Address: but only after Name: */
89 output chld_out, chld_err; 89 cmd_output chld_out, chld_err;
90 size_t i; 90 size_t i;
91 int is_nxdomain = FALSE; 91 int is_nxdomain = FALSE;
92 92
diff --git a/plugins/check_load.c b/plugins/check_load.c
index 0e4de54e..fdfa1da8 100644
--- a/plugins/check_load.c
+++ b/plugins/check_load.c
@@ -372,7 +372,7 @@ int cmpstringp(const void *p1, const void *p2) {
372 372
373static int print_top_consuming_processes() { 373static int print_top_consuming_processes() {
374 int i = 0; 374 int i = 0;
375 struct output chld_out, chld_err; 375 struct cmd_output chld_out, chld_err;
376 if(np_runcmd(PS_COMMAND, &chld_out, &chld_err, 0) != 0){ 376 if(np_runcmd(PS_COMMAND, &chld_out, &chld_err, 0) != 0){
377 fprintf(stderr, _("'%s' exited with non-zero status.\n"), PS_COMMAND); 377 fprintf(stderr, _("'%s' exited with non-zero status.\n"), PS_COMMAND);
378 return STATE_UNKNOWN; 378 return STATE_UNKNOWN;
diff --git a/plugins/check_nagios.c b/plugins/check_nagios.c
index 40d68f03..d58a2d57 100644
--- a/plugins/check_nagios.c
+++ b/plugins/check_nagios.c
@@ -77,7 +77,7 @@ main (int argc, char **argv)
77 int expected_cols = PS_COLS - 1; 77 int expected_cols = PS_COLS - 1;
78 const char *zombie = "Z"; 78 const char *zombie = "Z";
79 char *temp_string; 79 char *temp_string;
80 output chld_out, chld_err; 80 cmd_output chld_out, chld_err;
81 size_t i; 81 size_t i;
82 82
83 setlocale (LC_ALL, ""); 83 setlocale (LC_ALL, "");
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index a025ee89..931d3dc0 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -152,7 +152,7 @@ main (int argc, char **argv)
152 int i = 0, j = 0; 152 int i = 0, j = 0;
153 int result = STATE_UNKNOWN; 153 int result = STATE_UNKNOWN;
154 int ret = 0; 154 int ret = 0;
155 output chld_out, chld_err; 155 cmd_output chld_out, chld_err;
156 156
157 setlocale (LC_ALL, ""); 157 setlocale (LC_ALL, "");
158 bindtextdomain (PACKAGE, LOCALEDIR); 158 bindtextdomain (PACKAGE, LOCALEDIR);
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index bd13e579..205f7ee8 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -196,7 +196,7 @@ main (int argc, char **argv)
196 char *th_warn=NULL; 196 char *th_warn=NULL;
197 char *th_crit=NULL; 197 char *th_crit=NULL;
198 char type[8] = ""; 198 char type[8] = "";
199 output chld_out, chld_err; 199 struct cmd_output chld_out, chld_err;
200 char *previous_string=NULL; 200 char *previous_string=NULL;
201 char *ap=NULL; 201 char *ap=NULL;
202 char *state_string=NULL; 202 char *state_string=NULL;
diff --git a/plugins/negate.c b/plugins/negate.c
index 50f62d33..f3d0c376 100644
--- a/plugins/negate.c
+++ b/plugins/negate.c
@@ -62,7 +62,7 @@ main (int argc, char **argv)
62 int result = STATE_UNKNOWN; 62 int result = STATE_UNKNOWN;
63 char *sub; 63 char *sub;
64 char **command_line; 64 char **command_line;
65 output chld_out, chld_err; 65 cmd_output chld_out, chld_err;
66 int i; 66 int i;
67 67
68 setlocale (LC_ALL, ""); 68 setlocale (LC_ALL, "");
diff --git a/plugins/runcmd.c b/plugins/runcmd.c
index a7155d27..8919a9fb 100644
--- a/plugins/runcmd.c
+++ b/plugins/runcmd.c
@@ -71,7 +71,7 @@ static pid_t *np_pids = NULL;
71static int np_runcmd_open(const char *, int *, int *) 71static int np_runcmd_open(const char *, int *, int *)
72 __attribute__((__nonnull__(1, 2, 3))); 72 __attribute__((__nonnull__(1, 2, 3)));
73 73
74static int np_fetch_output(int, output *, int) 74static int np_fetch_output(int, cmd_output *, int)
75 __attribute__((__nonnull__(2))); 75 __attribute__((__nonnull__(2)));
76 76
77static int np_runcmd_close(int); 77static int np_runcmd_close(int);
@@ -253,7 +253,7 @@ runcmd_timeout_alarm_handler (int signo)
253 253
254 254
255static int 255static int
256np_fetch_output(int fd, output *op, int flags) 256np_fetch_output(int fd, cmd_output *op, int flags)
257{ 257{
258 size_t len = 0, i = 0, lineno = 0; 258 size_t len = 0, i = 0, lineno = 0;
259 size_t rsf = 6, ary_size = 0; /* rsf = right shift factor, dec'ed uncond once */ 259 size_t rsf = 6, ary_size = 0; /* rsf = right shift factor, dec'ed uncond once */
@@ -322,13 +322,13 @@ np_fetch_output(int fd, output *op, int flags)
322 322
323 323
324int 324int
325np_runcmd(const char *cmd, output *out, output *err, int flags) 325np_runcmd(const char *cmd, cmd_output *out, cmd_output *err, int flags)
326{ 326{
327 int fd, pfd_out[2], pfd_err[2]; 327 int fd, pfd_out[2], pfd_err[2];
328 328
329 /* initialize the structs */ 329 /* initialize the structs */
330 if(out) memset(out, 0, sizeof(output)); 330 if(out) memset(out, 0, sizeof(cmd_output));
331 if(err) memset(err, 0, sizeof(output)); 331 if(err) memset(err, 0, sizeof(cmd_output));
332 332
333 if((fd = np_runcmd_open(cmd, pfd_out, pfd_err)) == -1) 333 if((fd = np_runcmd_open(cmd, pfd_out, pfd_err)) == -1)
334 die (STATE_UNKNOWN, _("Could not open pipe: %s\n"), cmd); 334 die (STATE_UNKNOWN, _("Could not open pipe: %s\n"), cmd);
diff --git a/plugins/runcmd.h b/plugins/runcmd.h
index 2dcdadf0..14dde581 100644
--- a/plugins/runcmd.h
+++ b/plugins/runcmd.h
@@ -28,7 +28,7 @@
28#include "utils_cmd.h" /* for the "output" type */ 28#include "utils_cmd.h" /* for the "output" type */
29 29
30/** prototypes **/ 30/** prototypes **/
31int np_runcmd(const char *, output *, output *, int); 31int np_runcmd(const char *, cmd_output *, cmd_output *, int);
32void runcmd_timeout_alarm_handler(int) 32void runcmd_timeout_alarm_handler(int)
33 __attribute__((__noreturn__)); 33 __attribute__((__noreturn__));
34 34