summaryrefslogtreecommitdiffstats
path: root/web/attachments/141582-diff
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/141582-diff')
-rw-r--r--web/attachments/141582-diff106
1 files changed, 106 insertions, 0 deletions
diff --git a/web/attachments/141582-diff b/web/attachments/141582-diff
new file mode 100644
index 0000000..f956a50
--- /dev/null
+++ b/web/attachments/141582-diff
@@ -0,0 +1,106 @@
1--- check_nwstat.c 2005-07-11 08:08:39.000000000 +0000
2+++ check_nwstat_patched.c 2005-07-11 08:07:02.000000000 +0000
3@@ -169,6 +169,10 @@
4 if (result!=STATE_OK)
5 return result;
6 utilization=strtoul(recv_buffer,NULL,10);
7+
8+ close(sd);
9+ my_tcp_connect (server_address, server_port, &sd);
10+
11 send_buffer = strdup ("UPTIME\r\n");
12 result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
13 if (result!=STATE_OK)
14@@ -325,20 +329,24 @@
15
16 free_disk_space=strtoul(recv_buffer,NULL,10);
17
18+ close(sd);
19+ my_tcp_connect (server_address, server_port, &sd);
20+
21 asprintf (&send_buffer,"VKS%s\r\n",volume_name);
22 result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
23 if (result!=STATE_OK)
24 return result;
25 total_disk_space=strtoul(recv_buffer,NULL,10);
26
27- percent_free_space=(int)(((double)free_disk_space/(double)total_disk_space)*100.0);
28+ percent_free_space=(unsigned long)(((double)free_disk_space/(double)total_disk_space)*100.0);
29
30 if (check_critical_value==TRUE && percent_free_space <= critical_value)
31 result=STATE_CRITICAL;
32 else if (check_warning_value==TRUE && percent_free_space <= warning_value)
33 result=STATE_WARNING;
34 free_disk_space/=1024;
35- asprintf (&output_message,_("%lu MB (%lu%%) free on volume %s"),free_disk_space,percent_free_space,volume_name);
36+ total_disk_space/=1024;
37+ asprintf (&output_message,_("%lu MB (%lu%%) free on volume %s - total %lu MB"),free_disk_space,percent_free_space,volume_name,total_disk_space);
38 }
39
40 /* check to see if DS Database is open or closed */
41@@ -353,6 +361,9 @@
42 else
43 result=STATE_WARNING;
44
45+ close(sd);
46+ my_tcp_connect (server_address, server_port, &sd);
47+
48 send_buffer = strdup ("S13\r\n");
49 result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
50 temp_buffer=strtok(recv_buffer,"\r\n");
51@@ -472,7 +483,7 @@
52 return result;
53 total_disk_space=strtoul(recv_buffer,NULL,10);
54
55- percent_purgeable_space=(int)(((double)purgeable_disk_space/(double)total_disk_space)*100.0);
56+ percent_purgeable_space=(unsigned long)(((double)purgeable_disk_space/(double)total_disk_space)*100.0);
57
58 if (check_critical_value==TRUE && percent_purgeable_space >= critical_value)
59 result=STATE_CRITICAL;
60@@ -525,7 +536,7 @@
61 return result;
62 total_disk_space=strtoul(recv_buffer,NULL,10);
63
64- percent_non_purgeable_space=(int)(((double)non_purgeable_disk_space/(double)total_disk_space)*100.0);
65+ percent_non_purgeable_space=(unsigned long)(((double)non_purgeable_disk_space/(double)total_disk_space)*100.0);
66
67 if (check_critical_value==TRUE && percent_non_purgeable_space >= critical_value)
68 result=STATE_CRITICAL;
69@@ -579,6 +590,9 @@
70
71 max_service_processes=atoi(recv_buffer);
72
73+ close(sd);
74+ my_tcp_connect (server_address, server_port, &sd);
75+
76 asprintf (&send_buffer,"S21\r\n");
77 result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
78 if (result!=STATE_OK)
79@@ -671,12 +685,15 @@
80 asprintf (&output_message,_("NDS Version %s"),recv_buffer);
81
82 } else if (vars_to_check==UPTIME) {
83+ asprintf (&send_buffer,"UPTIME\r\n");
84 result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
85 if (result!=STATE_OK)
86 return result;
87
88- recv_buffer[strlen(recv_buffer)-1]=0;
89
90+ recv_buffer[sizeof(recv_buffer)-1]=0;
91+ recv_buffer[strlen(recv_buffer)-1]=0;
92+
93 asprintf (&output_message,_("Up %s"),recv_buffer);
94
95 } else if (vars_to_check==NLM) {
96@@ -865,8 +882,9 @@
97 vars_to_check=TSYNC;
98 else if (!strcmp(optarg,"DSVER"))
99 vars_to_check=DSVER;
100- else if (!strcmp(optarg,"UPTIME"))
101+ else if (!strcmp(optarg,"UPTIME")) {
102 vars_to_check=UPTIME;
103+ }
104 else if (strncmp(optarg,"NLM:",4)==0) {
105 vars_to_check=NLM;
106 nlm_name=strdup (optarg+4);