Easy to set up and use
by
mrnpage,
December 31, 2019
I've just installed this plugin on a CentOS 7 server running nagioscore 4.4.5 and have to say that it was very straight forward to set up !
The website has good instructions on installing the plugin as well as command, host, and service definitions to get you up and running nice and quickly.
I've only set up the command to check CPU usage on my Windows severs so far as I'm working with passive checks and nrdp but so far the results look good !
Invaluable tool
by
tompaah,
February 29, 2016
I use this on 100+ Windows servers 2008-2012R2 and mostly it works great. It's great not having to use the NSClient.
It uses a bit more resources on the monitoring server but for most I don't think it would be a problem.
For some reason it tends to time out quite often, even when the timout value is increased to 30 secs. Guess the Windows servers are busy doing something else..
Hello:
I made a change along the same lines as the comment above to allow for more exclusions to be specified. My change to the code is here:
# process any exclusions, if they have been defined
if ($the_arguments{'_arg2'}) {
# exclusion regex defined, decide if we want this row
my @excl = split(/,/,$the_arguments{'_arg2'});
foreach my $service_exclusion (@excl)
{
if ($$row{'DisplayName'}=~/$service_exclusion/ || $$row{'Name'}=~/$service_exclusion/) {
# regex matches so exclude this row
$num_excluded++;
$debug && print "---> Excluding "$$row{'DisplayName'}" ($$row{'Name'})n";
$process_this_row=0;
}
}
}
Thanks for this plugin, it is great!
Very good plugin!
by
dozla,
March 31, 2015
Very powerful plugin, no more messing around with NSClient++, just set it up and Monitor machines from XP to Server2012.
Just one little thing for users from other countries, check for the installation language, nonetheless I would recommend using english language, in case your server is installed in e.g. german, review some sql querys, as some parameters on the server might be in german.
Example: In check_wmi_plus/check_wmi_plus.d/check_sql.ini
#query=SELECT * FROM Win32_PerfFormattedData_MSSQLSERVER_SQLServerWaitStatistics where Name = "Average wait time (ms)"
query=SELECT * FROM Win32_PerfFormattedData_MSSQLSERVER_SQLServerWaitStatistics where Name = "Durchschnittliche Wartezeit (ms)"
Just a little mod and it fits our purpose
by
IamiceFi,
July 31, 2011
We made a change to checkservice in to the perl script so we can exclude services.
#-------------------------------------------------------------------------
sub checkservice {
# ------------------------ checking all services
my $where_bit='';
my $auto_mode='';
my $invert_mode='';
if (lc($the_arguments{'_arg1'}) eq 'auto') {
# for this query we need to look for all automatic services
# check that all auto services are
# STARTED=True, STATE=Running and STATUS=OK
# we do a query that actually always should return data so that we know that the query works
# we could do a select just listing the bad ones, but it returns nothing if good. hard to tell if it really worked ok.
$where_bit="where StartMode="auto"";
$auto_mode=1;
} elsif (lc($the_arguments{'_arg1'}) eq 'invert') {
$where_bit="where StartMode="auto"";
$auto_mode=1;
if ($the_arguments{'_arg2'} ne '') {
$invert_mode=1;
}
} else {
# for this query we have been passed a regex and must look for that
# so the WMI query should return all services and then we will apply the regex
# this is the default
}
# wmic returns something like:
# CLASS: Win32_Service
# DisplayName|Name|Started|StartMode|State|Status
# Telnet|TlntSvr|False|Auto|Stopped|OK
# Security Center|wscsvc|True|Auto|Running|OK
my @collected_data;
my $data_errors=get_multiple_wmi_samples(1,
"select displayname, Started, StartMode, State, Status FROM Win32_Service $where_bit",
'','',@collected_data,$the_arguments{'_delay'},undef,0);
check_for_data_errors($data_errors);
# at this point we can assume that we have all the data we need stored in @collected_data
my $result_text='';
# now loop through the results, showing the ones requested
my $num_ok=0;
my $num_bad=0;
# so we want to loop through all the rows in the first query result $collected_data[0]
foreach my $row (@{$collected_data[0]}) {
$debug && print "Service Info: " . Dumper($row);
# in the middle of the WMI output there are lines like:
# CLASS: Win32_Service
# CLASS: Win32_TerminalService
# which means DisplayName and Name might not be set so we need to test for this to stop
# "Use of uninitialized value in pattern match" errors
if ($$row{'DisplayName'} && $$row{'Name'}) {
if ( $auto_mode ||
( !$auto_mode && ($$row{'DisplayName'}=~/$the_arguments{'_arg1'}/i || $$row{'Name'}=~/$the_arguments{'_arg1'}/i) )
) {
if ($$row{'Started'} eq 'True' && $$row{'State'} eq 'Running' && $$row{'Status'} eq 'OK') {
$num_ok++;
if (!$auto_mode) {
# if we have using the regex mode then list out the services we find
$result_text.="'$$row{'DisplayName'}' ($$row{'Name'}) is $$row{'State'}, ";
}
} else {
if (!$invert_mode) {
$num_bad++;
$result_text.="'$$row{'DisplayName'}' ($$row{'Name'}) is $$row{'State'}, ";
} else {
if ($$row{'DisplayName'}!~/$the_arguments{'_arg2'}/i && $$row{'Name'}!~/$the_arguments{'_arg2'}/i) {
$num_bad++;
$result_text.="'$$row{'DisplayName'}' ($$row{'Name'}) is $$row{'State'}, ";
}
}
}
}
}
}
$result_text=~s/, $/./;
# load some values to check warn/crit against
$collected_data[0][0]{'_NumGood'}=$num_ok;
$collected_data[0][0]{'_NumBad'}=$num_bad;
$collected_data[0][0]{'_Total'}=$num_ok+$num_bad;
$collected_data[0][0]{'_ServiceList'}=$result_text;
my $test_result=test_limits($opt_warn,$opt_critical,$collected_data[0][0],%warn_perf_specs_parsed,%critical_perf_specs_parsed,@warn_spec_result_list,@critical_spec_result_list);
my ($this_display_info,$this_performance_data,$this_combined_data)=create_display_and_performance_data($collected_data[0][0],$display_fields{$opt_mode},$performance_data_fields{$opt_mode},%warn_perf_specs_
print $this_combined_data;
exit $test_result;
---------
So you'll have to give -a invert -o $ARG2 parameter where $ARG2 can be "service1|service2|service3" etc. The listed services will be excluded from the check.
Excellent dude
by
mrcoffee,
April 30, 2011
Downloaded and tested it and it's a very good plugin. Thank you for your additon to the Open Source community!
Roderick