1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
Index: check_dig.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dig.c,v
retrieving revision 1.7
diff -u -r1.7 check_dig.c
--- check_dig.c 21 Nov 2002 12:40:58 -0000 1.7
+++ check_dig.c 11 Dec 2002 02:40:59 -0000
@@ -57,7 +57,7 @@
usage ("Could not parse arguments\n");
/* get the command to run */
- asprintf (&command_line, "%s @%s %s", PATH_TO_DIG, dns_server, query_address);
+ asprintf (&command_line, "%s -t any @%s %s", PATH_TO_DIG, dns_server, query_address);
alarm (timeout_interval);
time (&start_time);
Index: check_dns.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dns.c,v
retrieving revision 1.5
diff -u -r1.5 check_dns.c
--- check_dns.c 14 Nov 2002 02:26:34 -0000 1.5
+++ check_dns.c 11 Dec 2002 02:40:59 -0000
@@ -308,7 +308,7 @@
timeout_interval = atoi (optarg);
break;
case 'H': /* hostname */
- if (is_host (optarg) == FALSE) {
+ if ((is_host (optarg)) == FALSE) {
printf ("Invalid host name/address\n\n");
print_usage ();
exit (STATE_UNKNOWN);
@@ -318,7 +318,7 @@
strcpy (query_address, optarg);
break;
case 's': /* server name */
- if (is_host (optarg) == FALSE) {
+ if ((is_host (optarg)) == FALSE) {
printf ("Invalid server name/address\n\n");
print_usage ();
exit (STATE_UNKNOWN);
@@ -328,7 +328,7 @@
strcpy (dns_server, optarg);
break;
case 'r': /* reverse server name */
- if (is_host (optarg) == FALSE) {
+ if ((is_host (optarg)) == FALSE) {
printf ("Invalid host name/address\n\n");
print_usage ();
exit (STATE_UNKNOWN);
@@ -338,7 +338,7 @@
strcpy (ptr_server, optarg);
break;
case 'a': /* expected address */
- if (is_dotted_quad (optarg) == FALSE) {
+ if ((is_ipv4_addr (optarg)) == FALSE) {
printf ("Invalid expected address\n\n");
print_usage ();
exit (STATE_UNKNOWN);
@@ -352,8 +352,8 @@
}
c = optind;
- if (query_address[0] == 0) {
- if (is_host (argv[c]) == FALSE) {
+ if (query_address == NULL) {
+ if ((is_host (argv[c])) == FALSE) {
printf ("Invalid name/address: %s\n\n", argv[c]);
return ERROR;
}
@@ -362,8 +362,8 @@
strcpy (query_address, argv[c++]);
}
- if (dns_server[0] == 0) {
- if (is_host (argv[c]) == FALSE) {
+ if (dns_server == NULL) {
+ if ((is_host (argv[c])) == FALSE) {
printf ("Invalid name/address: %s\n\n", argv[c]);
return ERROR;
}
Index: check_ldap.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ldap.c,v
retrieving revision 1.2
diff -u -r1.2 check_ldap.c
--- check_ldap.c 14 Nov 2002 02:26:34 -0000 1.2
+++ check_ldap.c 11 Dec 2002 02:40:59 -0000
@@ -7,7 +7,7 @@
*
* Last Modified: $Date: 2002/11/14 02:26:34 $
*
- * Command line: check_ldap -h <host> -b <base_dn> -p <port> -w <warn_time> -w <crit_time>
+ * Command line: check_ldap -H <host> -b <base_dn> -p <port> -w <warn_time> -w <crit_time>
*
* Description:
*
@@ -197,7 +197,7 @@
crit_time = atoi (optarg);
break;
default:
- usage ("check_ldap: could not parse arguments\n");
+ usage ("check_ldap: could not parse unknown arguments\n");
break;
}
}
@@ -253,6 +253,6 @@
{
printf
("Usage: %s -H <host> -b <base_dn> -p <port> [-a <attr>] [-D <binddn>]\n"
- " [-P <password>] [-w <warn_time>] [-c <crit_time>] [-t timeout]\n"
+ " [-P <password>] -w <warn_time> -c <crit_time> [-t timeout]\n"
"(Note: all times are in seconds.)\n", PROGNAME);
}
Index: check_ping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ping.c,v
retrieving revision 1.10
diff -u -r1.10 check_ping.c
--- check_ping.c 13 Nov 2002 11:50:54 -0000 1.10
+++ check_ping.c 11 Dec 2002 02:40:59 -0000
@@ -88,9 +88,15 @@
/* does the host address of number of packets argument come first? */
#ifdef PING_PACKETS_FIRST
- asprintf (&command_line, PING_COMMAND, max_packets, server_address);
+ if (is_ipv6_addr (server_address))
+ asprintf (&command_line, PING6_COMMAND, max_packets, server_address);
+ else
+ asprintf (&command_line, PING_COMMAND, max_packets, server_address);
#else
- asprintf (&command_line, PING_COMMAND, server_address, max_packets);
+ if (is_ipv6_addr (server_address))
+ asprintf (&command_line, PING6_COMMAND, server_address, max_packets);
+ else
+ asprintf (&command_line, PING_COMMAND, server_address, max_packets);
#endif
/* Set signal handling and alarm */
Index: check_tcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
retrieving revision 1.8
diff -u -r1.8 check_tcp.c
--- check_tcp.c 25 Nov 2002 12:00:17 -0000 1.8
+++ check_tcp.c 11 Dec 2002 02:40:59 -0000
@@ -225,8 +225,12 @@
{
if (PROTOCOL == UDP_PROTOCOL)
result = my_udp_connect (server_address, server_port, &sd);
- else /* default is TCP */
- result = my_tcp_connect (server_address, server_port, &sd);
+ else
+ /* default is TCP */
+ // result = my_tcp_connect (server_address, server_port, &sd);
+ result = my_connect (server_address, server_port, &sd, IPPROTO_TCP);
+printf ("Catch value: %d\n", result);
+printf ("XXX: Check valve\n");
}
if (result == STATE_CRITICAL)
Index: check_udp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_udp.c,v
retrieving revision 1.2
diff -u -r1.2 check_udp.c
--- check_udp.c 30 Oct 2002 18:46:01 -0000 1.2
+++ check_udp.c 11 Dec 2002 02:40:59 -0000
@@ -74,9 +74,8 @@
alarm (socket_timeout);
time (&start_time);
- result =
- process_udp_request (server_address, server_port, server_send,
- recv_buffer, MAX_INPUT_BUFFER - 1);
+ result = process_udp_request (server_address, server_port, server_send,
+ recv_buffer, MAX_INPUT_BUFFER - 1);
time (&end_time);
if (result != STATE_OK) {
|