Source
xxxxxxxxxx
critical_used_space = ( critical_value > 100 )?critical_value*1024.0*1024:(critical_value*1.0 / 100) * total_disk_space;
/******************************************************************************
*
* CHECK_NT.C -modified from official plugins version 1.4 beta1
* downloaded on Jan 30,2005
*
* Program: Windows NT plugin for Nagios
* License: GPL
* Copyright (c) 2000-2002 Yves Rubin (rubiyz@yahoo.com)
*
* Description:
*
* This requires NSClient software to run on NT (http://nsclient.ready2run.nl/)
*
* License Information:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: check_nt.c,v 1.24 2005/04/23 11:54:01 amontibello Exp $
*
*****************************************************************************/
const char *progname = "check_nc_net";
const char *revision = "$Revision: 1.24 $";
const char *copyright = "2003-2005";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
enum checkvars {
CHECK_NONE,
CHECK_CLIENTVERSION,
CHECK_CPULOAD,
CHECK_UPTIME,
CHECK_USEDDISKSPACE,
CHECK_FREEDISKSPACE,
CHECK_SERVICESTATE,
CHECK_PROCSTATE,
CHECK_MEMUSE,
CHECK_COUNTER,
CHECK_FILEAGE,
CHECK_INSTANCES,
CHECK_EVENTLOG,
CHECK_WMICHECK,
CHECK_CONFIG,
ENUM_CONFIG,
ENUM_PASSIVE,
/* ADDPASSIVE - is implemented as a switch -S */
CONFIG_DELPASSIVE,
ENUM_PROCESS,
ENUM_SERVICE,
CHECK_WMICOUNTER,
ENUM_COUNTER,
ENUM_COUNTERDESC,
CHECK_WMICAT
};
enum {
MAX_VALUE_LIST = 30,
PORT = 1248
};
char *server_address=NULL;
char *volume_name=NULL;
int server_port=PORT;
char *value_list=NULL;
char *req_password=NULL;
char *service_desc=NULL;
char *check_type=NULL;
unsigned long lvalue_list[MAX_VALUE_LIST];
unsigned long warning_value=0L;
unsigned long critical_value=0L;
int check_warning_value=FALSE;
int check_critical_value=FALSE;
char *critical_value_string=NULL;
char *warning_value_string=NULL;
enum checkvars vars_to_check = CHECK_NONE;
int show_all=FALSE;