summaryrefslogtreecommitdiffstats
path: root/web/attachments/136841-newdiff
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/136841-newdiff')
-rw-r--r--web/attachments/136841-newdiff87
1 files changed, 87 insertions, 0 deletions
diff --git a/web/attachments/136841-newdiff b/web/attachments/136841-newdiff
new file mode 100644
index 0000000..371d0a8
--- /dev/null
+++ b/web/attachments/136841-newdiff
@@ -0,0 +1,87 @@
1Index: check_tcp.c
2===================================================================
3RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
4retrieving revision 1.65
5diff -r1.65 check_tcp.c
6166a167,176
7> else if (strstr (argv[0], "check_clamd")) {
8> progname = strdup ("check_clamd");
9> SERVICE = strdup ("CLAMD");
10> SEND = strdup ("PING");
11> EXPECT = strdup ("PONG");
12> QUIT = NULL;
13> PROTOCOL = IPPROTO_TCP;
14> PORT = 3310;
15> }
16>
17380,381c390,397
18<
19< printf
20---
21> if(server_address[0]=='/')
22> printf
23> (_("%s %s%s - %.3f second response on socket %s"),
24> SERVICE,
25> state_text (result),
26> (was_refused) ? " (refused)" : "",
27> elapsed_time, server_address);
28> else printf
29488c504
30< if (is_host (optarg) == FALSE)
31---
32> if (optarg[0]!= '/' && is_host (optarg) == FALSE)
33763c779
34< printf (_("This plugin tests %s connections with the specified host.\n\n"),
35---
36> printf (_("This plugin tests %s connections with the specified host or unix socket.\n\n"),
37Index: netutils.c
38===================================================================
39RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/netutils.c,v
40retrieving revision 1.24
41diff -r1.24 netutils.c
42166a167
43>
44172a174
45> if (host_name[0] != '/') {
46212a215,239
47> }
48> else{ // unix socket
49> struct sockaddr_un su;
50> if (strlen(host_name) >= sizeof(su.sun_path)) {
51> printf("Hostname too long for unix domain socket: %s\n",
52> host_name);
53> return STATE_UNKNOWN;
54> }
55> memset(&su, 0, sizeof su);
56> su.sun_family = AF_UNIX;
57> strncpy(su.sun_path, host_name, sizeof su.sun_path);
58> *sd = socket(PF_UNIX, SOCK_STREAM, 0);
59> if ( sd < 0) {
60> printf ("Socket creation failed\n");
61> return STATE_UNKNOWN;
62> }
63> result=connect(*sd, (struct sockaddr *)&su, sizeof su);
64> if (result == -1) {
65> printf ("Connect to socket failed\n");
66> close(*sd);
67> return STATE_UNKNOWN;
68> }
69>
70> }
71>
72Index: netutils.h
73===================================================================
74RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/netutils.h,v
75retrieving revision 1.12
76diff -r1.12 netutils.h
7737a38
78> #include <sys/un.h>
79Index: utils.h
80===================================================================
81RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/utils.h,v
82retrieving revision 1.22
83diff -r1.22 utils.h
84139c139
85< Host name or IP Address\n\
86---
87> Host name or IP Address or unix socket (starting with \"/\")\n\