diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2003-09-15 14:57:58 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2003-09-15 14:57:58 +0000 |
commit | 5436e674db23943d991268d2adfbd83527059b8b (patch) | |
tree | a9c5f2f4a8b5d1401ec3eae8d0ccf84fb4000c07 /plugins/check_nt.c | |
parent | 4c17ca60a0b22dc269dbc5f26168dd0263e71e47 (diff) | |
download | monitoring-plugins-5436e674db23943d991268d2adfbd83527059b8b.tar.gz |
Option to verify check_nt version (799098 - Steve Hanselman)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@725 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_nt.c')
-rw-r--r-- | plugins/check_nt.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/check_nt.c b/plugins/check_nt.c index c0d6c4e5..75936620 100644 --- a/plugins/check_nt.c +++ b/plugins/check_nt.c | |||
@@ -58,7 +58,6 @@ char *req_password=NULL; | |||
58 | unsigned long lvalue_list[MAX_VALUE_LIST]; | 58 | unsigned long lvalue_list[MAX_VALUE_LIST]; |
59 | unsigned long warning_value=0L; | 59 | unsigned long warning_value=0L; |
60 | unsigned long critical_value=0L; | 60 | unsigned long critical_value=0L; |
61 | int check_value_list=FALSE; | ||
62 | int check_warning_value=FALSE; | 61 | int check_warning_value=FALSE; |
63 | int check_critical_value=FALSE; | 62 | int check_critical_value=FALSE; |
64 | enum checkvars vars_to_check = CHECK_NONE; | 63 | enum checkvars vars_to_check = CHECK_NONE; |
@@ -115,8 +114,13 @@ int main(int argc, char **argv){ | |||
115 | 114 | ||
116 | asprintf(&send_buffer, "%s&1", req_password); | 115 | asprintf(&send_buffer, "%s&1", req_password); |
117 | fetch_data (server_address, server_port, send_buffer); | 116 | fetch_data (server_address, server_port, send_buffer); |
118 | output_message = strdup (recv_buffer); | 117 | if (value_list != NULL && strcmp(recv_buffer, value_list) != 0) { |
119 | return_code=STATE_OK; | 118 | asprintf (&output_message, _("Wrong client version - running: %s, required: %s"), recv_buffer, value_list); |
119 | return_code = STATE_WARNING; | ||
120 | } else { | ||
121 | asprintf (&output_message, recv_buffer); | ||
122 | return_code = STATE_OK; | ||
123 | } | ||
120 | break; | 124 | break; |
121 | 125 | ||
122 | case CHECK_CPULOAD: | 126 | case CHECK_CPULOAD: |
@@ -536,7 +540,8 @@ Windows NT/2000/XP server.\n\n")); | |||
536 | -v, --variable=STRING\n\ | 540 | -v, --variable=STRING\n\ |
537 | Variable to check. Valid variables are:\n")); | 541 | Variable to check. Valid variables are:\n")); |
538 | printf (_("\ | 542 | printf (_("\ |
539 | CLIENTVERSION = Get the NSClient version\n")); | 543 | CLIENTVERSION = Get the NSClient version\n\ |
544 | If -l <version> is specified, will return warning if versions differ.\n")); | ||
540 | printf (_("\ | 545 | printf (_("\ |
541 | CPULOAD = Average CPU load on last x minutes.\n\ | 546 | CPULOAD = Average CPU load on last x minutes.\n\ |
542 | Request a -l parameter with the following syntax:\n\ | 547 | Request a -l parameter with the following syntax:\n\ |