summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6326b0f)
raw | patch | inline | side by side (parent: 6326b0f)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Tue, 8 Apr 2003 20:37:13 +0000 (20:37 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Tue, 8 Apr 2003 20:37:13 +0000 (20:37 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@478 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_hpjd.c | patch | blob | history | |
plugins/check_nt.c | patch | blob | history |
diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c
index d8583724391aadcc644ea91fac3d9d0015b16e2d..9d8fae2b6f3f1bc72670be18fe00cb92cc78a442 100644 (file)
--- a/plugins/check_hpjd.c
+++ b/plugins/check_hpjd.c
return STATE_UNKNOWN;
}
- // get the IP address of the JetDirect device
+ /* get the IP address of the JetDirect device */
strcpy(address,argv[1]);
- // get the community name to use for SNMP communication
+ /* get the community name to use for SNMP communication */
if(argc>=3)
strcpy(community,argv[2]);
else
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
index b29d8b7a4ddefd6ddbc1fae9d348d4a5bff22cb2..1305a33362a426b76a57e05ebf787a476bf476ee 100644 (file)
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
*
*****************************************************************************/
-//#include "stdlib.h"
#include "config.h"
#include "common.h"
#include "netutils.h"
if (check_value_list==TRUE) {
if (strtolarray(&lvalue_list,value_list,",")==TRUE) {
- // -l parameters is present with only integers
+ /* -l parameters is present with only integers */
return_code=STATE_OK;
asprintf(&temp_string,"CPU Load");
while (lvalue_list[0+offset]>0 && lvalue_list[0+offset]<=17280 &&
lvalue_list[1+offset]>=0 && lvalue_list[1+offset]<=100 &&
lvalue_list[2+offset]>=0 && lvalue_list[2+offset]<=100) {
- // loop until one of the parameters is wrong or not present
+ /* loop until one of the parameters is wrong or not present */
- // Send request and retrieve data
+ /* Send request and retrieve data */
asprintf(&send_buffer,"%s&2&%lu",req_password,lvalue_list[0+offset]);
result=process_tcp_request(server_address,server_port,send_buffer,recv_buffer,sizeof(recv_buffer));
if(result!=STATE_OK)
utilization=strtoul(recv_buffer,NULL,10);
- // Check if any of the request is in a warning or critical state
+ /* Check if any of the request is in a warning or critical state */
if(utilization >= lvalue_list[2+offset])
return_code=STATE_CRITICAL;
else if(utilization >= lvalue_list[1+offset] && return_code<STATE_WARNING)
asprintf(&output_message," %lu%% (%lu min average)", utilization, lvalue_list[0+offset]);
asprintf(&temp_string,"%s%s",temp_string,output_message);
- offset+=3; //move across the array
+ offset+=3; /* move across the array */
}
if (strlen(temp_string)>10) {
- // we had at least on loop
+ /* we had at least on loop */
asprintf(&output_message,"%s",temp_string);
}
else
else if(vars_to_check==CHECK_SERVICESTATE || vars_to_check==CHECK_PROCSTATE){
if (check_value_list==TRUE) {
- preparelist(value_list); // replace , between services with & to send the request
+ preparelist(value_list); /* replace , between services with & to send the request */
asprintf(&send_buffer,"%s&%u&%s&%s", req_password,(vars_to_check==CHECK_SERVICESTATE)?5:6,
(show_all==TRUE)?"ShowAll":"ShowFail",value_list);
result=process_tcp_request(server_address,server_port,send_buffer,recv_buffer,sizeof(recv_buffer));
else if(vars_to_check==CHECK_COUNTER) {
if (check_value_list==TRUE) {
- preparelist(value_list); // replace , between services with & to send the request
+ preparelist(value_list); /* replace , between services with & to send the request */
asprintf(&send_buffer,"%s&8&%s", req_password,value_list);
result=process_tcp_request(server_address,server_port,send_buffer,recv_buffer,sizeof(recv_buffer));
if (result!=STATE_OK)
exit(STATE_UNKNOWN);
}
- strtok(value_list,"&"); // burn the first parameters
+ strtok(value_list,"&"); /* burn the first parameters */
description = strtok(NULL,"&");
counter_value = atof(recv_buffer);
if (description == NULL)
asprintf(&output_message, description, counter_value);
if (critical_value > warning_value) {
- // Normal thresholds
+ /* Normal thresholds */
if(check_critical_value==TRUE && counter_value >= critical_value)
return_code=STATE_CRITICAL;
else if (check_warning_value==TRUE && counter_value >= warning_value)
return_code=STATE_OK;
}
else {
- // inverse thresholds
+ /* inverse thresholds */
if(check_critical_value==TRUE && counter_value <= critical_value)
return_code=STATE_CRITICAL;
else if (check_warning_value==TRUE && counter_value <= warning_value)
else if(vars_to_check==CHECK_FILEAGE) {
if (check_value_list==TRUE) {
- preparelist(value_list); // replace , between services with & to send the request
+ preparelist(value_list); /* replace , between services with & to send the request */
asprintf(&send_buffer,"%s&9&%s", req_password,value_list);
result=process_tcp_request(server_address,server_port,send_buffer,recv_buffer,sizeof(recv_buffer));
if (result!=STATE_OK)
asprintf(&output_message, description);
if (critical_value > warning_value) {
- // Normal thresholds
+ /* Normal thresholds */
if(check_critical_value==TRUE && age_in_minutes >= critical_value)
return_code=STATE_CRITICAL;
else if (check_warning_value==TRUE && age_in_minutes >= warning_value)
return_code=STATE_OK;
}
else {
- // inverse thresholds
+ /* inverse thresholds */
if(check_critical_value==TRUE && age_in_minutes <= critical_value)
return_code=STATE_CRITICAL;
else if (check_warning_value==TRUE && age_in_minutes <= warning_value)
}
int strtolarray(unsigned long *array, char *string, char *delim) {
- // split a <delim> delimited string into a long array
+ /* split a <delim> delimited string into a long array */
int idx=0;
char *t1;
}
void preparelist(char *string) {
- // Replace all , with & which is the delimiter for the request
+ /* Replace all , with & which is the delimiter for the request */
int i;
for (i = 0; i < strlen(string); i++)