diff options
Diffstat (limited to 'web/attachments/122140-diff')
-rw-r--r-- | web/attachments/122140-diff | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/web/attachments/122140-diff b/web/attachments/122140-diff new file mode 100644 index 0000000..736b1c1 --- /dev/null +++ b/web/attachments/122140-diff | |||
@@ -0,0 +1,91 @@ | |||
1 | Index: check_tcp.c | ||
2 | =================================================================== | ||
3 | RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v | ||
4 | retrieving revision 1.61 | ||
5 | diff -r1.61 check_tcp.c | ||
6 | 99c99 | ||
7 | < int use_ssl = FALSE; | ||
8 | --- | ||
9 | > int use_ssl = FALSE; | ||
10 | 170a171,180 | ||
11 | > else if (strstr (argv[0], "check_clamd")) { | ||
12 | > progname = strdup ("check_clamd"); | ||
13 | > SERVICE = strdup ("CLAMD"); | ||
14 | > SEND = strdup ("PING"); | ||
15 | > EXPECT = strdup ("PONG"); | ||
16 | > QUIT = NULL; | ||
17 | > PROTOCOL = TCP_PROTOCOL; | ||
18 | > PORT = 3310; | ||
19 | > } | ||
20 | > | ||
21 | 378,379c388,395 | ||
22 | < | ||
23 | < printf | ||
24 | --- | ||
25 | > if(server_address[0]=='/') | ||
26 | > printf | ||
27 | > (_("%s %s%s - %.3f second response on socket %s"), | ||
28 | > SERVICE, | ||
29 | > state_text (result), | ||
30 | > (was_refused) ? " (refused)" : "", | ||
31 | > elapsed_time, server_address); | ||
32 | > else printf | ||
33 | 486c502 | ||
34 | < if (is_host (optarg) == FALSE) | ||
35 | --- | ||
36 | > if (optarg[0]!= '/' && is_host (optarg) == FALSE) | ||
37 | 761c777 | ||
38 | < printf (_("This plugin tests %s connections with the specified host.\n\n"), | ||
39 | --- | ||
40 | > printf (_("This plugin tests %s connections with the specified host or unix socket.\n\n"), | ||
41 | Index: netutils.c | ||
42 | =================================================================== | ||
43 | RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/netutils.c,v | ||
44 | retrieving revision 1.22 | ||
45 | diff -r1.22 netutils.c | ||
46 | 221a222 | ||
47 | > | ||
48 | 227a229 | ||
49 | > if (host_name[0] != '/') { | ||
50 | 267a270,294 | ||
51 | > } | ||
52 | > else{ // unix socket | ||
53 | > struct sockaddr_un su; | ||
54 | > if (strlen(host_name) >= sizeof(su.sun_path)) { | ||
55 | > printf("Hostname too long for unix domain socket: %s\n", | ||
56 | > host_name); | ||
57 | > return STATE_UNKNOWN; | ||
58 | > } | ||
59 | > memset(&su, 0, sizeof su); | ||
60 | > su.sun_family = AF_UNIX; | ||
61 | > strncpy(su.sun_path, host_name, sizeof su.sun_path); | ||
62 | > *sd = socket(PF_UNIX, SOCK_STREAM, 0); | ||
63 | > if ( sd < 0) { | ||
64 | > printf ("Socket creation failed\n"); | ||
65 | > return STATE_UNKNOWN; | ||
66 | > } | ||
67 | > result=connect(*sd, (struct sockaddr *)&su, sizeof su); | ||
68 | > if (result == -1) { | ||
69 | > printf ("Connect to socket failed\n"); | ||
70 | > close(*sd); | ||
71 | > return STATE_UNKNOWN; | ||
72 | > } | ||
73 | > | ||
74 | > } | ||
75 | > | ||
76 | Index: netutils.h | ||
77 | =================================================================== | ||
78 | RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/netutils.h,v | ||
79 | retrieving revision 1.10 | ||
80 | diff -r1.10 netutils.h | ||
81 | 37a38 | ||
82 | > #include <sys/un.h> | ||
83 | Index: utils.h | ||
84 | =================================================================== | ||
85 | RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/utils.h,v | ||
86 | retrieving revision 1.22 | ||
87 | diff -r1.22 utils.h | ||
88 | 139c139 | ||
89 | < Host name or IP Address\n\ | ||
90 | --- | ||
91 | > Host name or IP Address or unix socket (starting with \"/\")\n\ | ||