summaryrefslogtreecommitdiffstats
path: root/plugins/runcmd.h
diff options
context:
space:
mode:
authorM. Sean Finney <seanius@users.sourceforge.net>2005-06-29 04:11:29 (GMT)
committerM. Sean Finney <seanius@users.sourceforge.net>2005-06-29 04:11:29 (GMT)
commit290c9b1077eeb1a3acc2b2e1ffacca3571acf30d (patch)
tree814629ebb1980142c7d468cf5563cc86ac9f0630 /plugins/runcmd.h
parent49b7afb02704b8d37b0e863efb2651c5ca1cb70f (diff)
downloadmonitoring-plugins-290c9b1077eeb1a3acc2b2e1ffacca3571acf30d.tar.gz
initial versions of the runcmd framework by andreas
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1197 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/runcmd.h')
-rw-r--r--plugins/runcmd.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/runcmd.h b/plugins/runcmd.h
new file mode 100644
index 0000000..35ebc25
--- /dev/null
+++ b/plugins/runcmd.h
@@ -0,0 +1,39 @@
1/*
2 * $Id$
3 *
4 * Author: Andreas Ericsson <ae@op5.se>
5 *
6 * Copyright: GNU GPL v2 or any later version.
7 *
8 */
9
10#ifndef NAGIOSPLUG_RUNCMD_H
11#define NAGIOSPLUG_RUNCMD_H
12
13#include "common.h"
14
15/** types **/
16struct output {
17 char *buf; /* output buffer */
18 size_t buflen; /* output buffer content length */
19 char **line; /* array of lines (points to buf) */
20 size_t *lens; /* string lengths */
21 size_t lines; /* lines of output */
22};
23
24typedef struct output output;
25
26/** prototypes **/
27int np_runcmd(const char *, output *, output *, int);
28void popen_timeout_alarm_handler(int)
29 __attribute__((__noreturn__));
30
31/* only multi-threaded plugins need to bother with this */
32void np_runcmd_init(void);
33#define NP_RUNCMD_INIT np_runcmd_init()
34
35/* possible flags for np_runcmd()'s fourth argument */
36#define RUNCMD_NO_ARRAYS 0x01 /* don't populate arrays at all */
37#define RUNCMD_NO_ASSOC 0x02 /* output.line won't point to buf */
38
39#endif /* NAGIOSPLUG_RUNCMD_H */