check_wmi_plus.pl -checkdrivesize no historic perf data

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
kgugerty
Posts: 42
Joined: Wed May 04, 2016 8:28 am

check_wmi_plus.pl -checkdrivesize no historic perf data

Post by kgugerty »

We are using check_wmi_plus.pl to check the space on windows system drives. The settings are in place to process performance data for graphing.
Running through the steps on this page: https://support.nagios.com/kb/article.php?id=9 led me to an error in the log file:

Code: Select all

/usr/local/nagios/var/perfdata.log.
The error indicated there were too many variables being sent to rrd.

That error message led me to this page: https://support.nagios.com/kb/article.php?id=149
Reading through that page looks like the script provided should also fix the issue I am encountering. Where I get stuck is installing the RRD::Simple module of CPAN.

Code: Select all

cpan -i RRD::Simple
It fails to install with (abbreviated) :

Code: Select all

#   Failed test 'graph() return hash (monthly)'
#   at t/23graph1.t line 68.
# Compared $data->[0]
#    got : 'bytesIn min -nan'
# expect : 'bytesIn min nan'
Which led me to this page:
https://rt.cpan.org/Public/Bug/Display.html?id=78785
The fix on that page suggests that -nan is essentially the same as nan. So the patch is to just update the answer.pl file.

That fixed the above error, but I ran into another error identifying an issue with the value assigned to cur_row
This page had an answer to that: https://rt.cpan.org/Public/Bug/Display.html?id=46193
That fix led to another error with cdp_prep = undef but expected cdp_prep = 0.

At this point I had gone so far down the rabbit hole, that I think the real solution would be to upgrade something or install a missing module of some sort. I can't seem to find that answer though. Below is the version information.

Code: Select all

 cpan -D RRD::Simple

Code: Select all

Database was generated on Wed, 28 Jul 2021 20:17:03 GMT
RRD::Simple
-------------------------------------------------------------------------
        (no description)
        N/NI/NICOLAW/RRD-Simple-1.44.tar.gz
        (no installation file)
        Installed: not installed
        CPAN:      1.44  Not up to date
        Nicola Worthington (NICOLAW)
        nicolaw@cpan.org

Code: Select all

Summary of my perl5 (revision 5 version 26 subversion 3) configuration:

  Platform:
    osname=linux
    osvers=4.19.34-300.el7.x86_64
    archname=x86_64-linux-thread-multi
    uname='linux x86-01.mbox.centos.org 4.19.34-300.el7.x86_64 #1 smp mon apr 15 18:04:36 utc 2019 x86_64 x86_64 x86_64 gnulinux '
    config_args='-des -Doptimize=none -Dccflags=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Dldflags=-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Dccdlflags=-Wl,--enable-new-dtags -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Dlddlflags=-shared -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Dshrpdir=/usr/lib64 -DDEBUGGING=-g -Dversion=5.26.3 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl5 -Dsitearch=/usr/local/lib64/perl5 -Dprivlib=/usr/share/perl5 -Dvendorlib=/usr/share/perl5/vendor_perl -Darchlib=/usr/lib64/perl5 -Dvendorarch=/usr/lib64/perl5/vendor_perl -Darchname=x86_64-linux-thread-multi -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Duseshrplib -Dusethreads -Duseithreads -Dusedtrace=/usr/bin/dtrace -Duselargefiles -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl=n -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto -Ud_endservent_r_proto -Ud_setservent_r_proto -Dscriptdir=/usr/bin -Dusesitecustomize -Duse64bitint'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=define
    usemultiplicity=define
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='gcc'
    ccflags ='-D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    optimize='  -g'
    cppflags='-D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include'
    ccversion=''
    gccversion='8.2.1 20180905 (Red Hat 8.2.1-3)'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='gcc'
    ldflags ='-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib64 /lib64 /usr/lib64 /usr/local/lib /usr/lib /lib/../lib64 /usr/lib/../lib64 /lib
    libs=-lpthread -lresolv -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lpthread -lresolv -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.28.so
    so=so
    useshrplib=true
    libperl=libperl.so
    gnulibc_version='2.28'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,--enable-new-dtags -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'
    cccdlflags='-fPIC'
    lddlflags='-lpthread -shared -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L/usr/local/lib -fstack-protector-strong'


Characteristics of this binary (from libperl):
  Compile-time options:
    HAS_TIMES
    MULTIPLICITY
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_IMPLICIT_CONTEXT
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_ITHREADS
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
    USE_REENTRANT_API
    USE_SITECUSTOMIZE
  Locally applied patches:
    Fedora Patch1: Removes date check, Fedora/RHEL specific
    Fedora Patch3: support for libdir64
    Fedora Patch4: use libresolv instead of libbind
    Fedora Patch5: USE_MM_LD_RUN_PATH
    Fedora Patch6: Provide MM::maybe_command independently (bug #1129443)
    Fedora Patch7: Dont run one io test due to random builder failures
    Fedora Patch15: Define SONAME for libperl.so
    Fedora Patch16: Install libperl.so to -Dshrpdir value
    Fedora Patch22: Document Math::BigInt::CalcEmu requires Math::BigInt (CPAN RT#85015)
    Fedora Patch26: Make *DBM_File desctructors thread-safe (RT#61912)
    Fedora Patch27: Make PadlistNAMES() lvalue again (CPAN RT#101063)
    Fedora Patch30: Replace EU::MakeMaker dependency with EU::MM::Utils in IPC::Cmd (bug #1129443)
    Fedora Patch31: Make File::Glob more resistant against degenerative matching (RT#131211)
    Fedora Patch36: Fix glob UTF-8 flag on a glob reassignment (RT#131263)
    Fedora Patch38: Fix handling backslashes in PATH environment variable when executing "perl -S" (RT#129183)
    Fedora Patch45: Fix File::Glob rt131211.t test random failures
    Fedora Patch46: Fix t/op/hash.t test random failures
    Fedora Patch47: Parse caret variables with subscripts as normal variables inside ${...} escaping (RT#131664)
    Fedora Patch49: Do not display too many bytes when reporting malformed UTF-8 character
    Fedora Patch51: Fix error message for "our sub foo::bar" (RT#131679)
    Fedora Patch52: Fix executing arybase::_tie_it() in Safe compartement (RT#131588)
    Fedora Patch54: Fix splitting non-ASCII strings if unicode_strings feature is enabled (RT#130907)
    Fedora Patch55: Fix compiler warnings in code generated by ExtUtils::Constant (CPAN RT#63832)
    Fedora Patch56: Fix compiler warnings in code generated by ExtUtils::Constant (CPAN RT#101487)
    Fedora Patch58: Fix unreliable Time-HiRes tests (CPAN RT#122819)
    Fedora Patch61: Fix Term::ReadLine not to create spurious &STDERR files (RT#132008)
    Fedora Patch64: Fix an overflow when parsing a character range with no preceding character (RT#132245)
    Fedora Patch65: Fix walking symbol table for ISA in Carp
    Fedora Patch66: Fix handling file names with null bytes in stat and lstat functions (RT#131895)
    Fedora Patch67: Fix a crash when untying an object witout a stash
    Fedora Patch68: Fix deparsing of transliterations with unprintable characters (RT#132405)
    Fedora Patch69: Fix error reporting on do() on a directory (RT#125774)
    Fedora Patch70: Fix stack manipulation when a lexical subroutine is defined in a do block in a member of an iteration list (RT#132442)
    Fedora Patch71: Fix setting $! when statting a closed filehandle (RT#108288)
    Fedora Patch72: Fix tainting of s/// with overloaded replacement (RT#115266)
    Fedora Patch73: Expand system() arguments before a fork (RT#121105)
    Fedora Patch76: Avoid undefined behavior when copying memory in Glob and pp_caller (RT#131746)
    Fedora Patch78: Fix compatibility with libxcrypt (RT#133184)
    Fedora Patch79: Link XS modules to pthread library to fix linking with -z defs
    Fedora Patch80: Fix parsing braced subscript after parentheses (RT#8045)
    Fedora Patch81: Do not clobber file bytes in :encoding layer (RT#132833)
    Fedora Patch82: Fix line numbers in multi-line s/// (RT#131930)
    Fedora Patch83: Fix parsing extended bracketed character classes (RT#132167)
    Fedora Patch84: Fix a possibly unitialized memory read in the Perl parser (RT#133074)
    Fedora Patch85: Fix an infinite loop in the regular expression compiler (RT#133185)
    Fedora Patch86: Adjust tests to gdbm-1.15 (RT#133295)
    Fedora Patch88: Fix printing a warning about a wide character when matching a regular expression while ISO-8859-1 locale is in effect
    Fedora Patch89: Fix invoking a check for wide characters while ISO-8859-1 locale is in effect
    Fedora Patch90: Pass the correct CFLAGS to dtrace
    Fedora Patch200: Link XS modules to libperl.so with EU::CBuilder on Linux
    Fedora Patch201: Link XS modules to libperl.so with EU::MM on Linux
  Built under linux
  Compiled at May 11 2019 15:17:55
  @INC:
    /usr/local/lib64/perl5
    /usr/local/share/perl5
    /usr/lib64/perl5/vendor_perl
    /usr/share/perl5/vendor_perl
    /usr/lib64/perl5
    /usr/share/perl5
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: check_wmi_plus.pl -checkdrivesize no historic perf data

Post by gsmith »

Hi
The error indicated there were too many variables being sent to rrd.
This usually means the command for this service changed, or what the service is monitoring.

If you are checking disk usage on a machine, and someone installs another drive, then the check will
send info for two drives to rrd, while the rrdtool is only expecting one.

Do you know if the command got changed? or did what is being monitored get changed?

Please send me the command you are using.

Thanks
kgugerty
Posts: 42
Joined: Wed May 04, 2016 8:28 am

Re: check_wmi_plus.pl -checkdrivesize no historic perf data

Post by kgugerty »

If you are checking disk usage on a machine, and someone installs another drive, then the check will
send info for two drives to rrd, while the rrdtool is only expecting one.
ok this is interesting. The command is static, but the machine drives can be dynamic in our environment.

So it seems like I may need to setup a chron job to run this script on a regular basis.

That brings me back to the script. It requires rrd::Simple, but rrd::Simple does not install due to a error messages previously mentioned.

Code: Select all

$USER1$/check_wmi_plus.pl -H $HOSTADDRESS$ -m checkdrivesize -a "."  
This command is applied to all 1700+ servers in our environment. There are critical and warning indicators setup as well. I am assuming you were interested in the -a "." which tells it to grab ALL drives on the system.
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: check_wmi_plus.pl -checkdrivesize no historic perf data

Post by gsmith »

Hi,

I'll get an environment set up and will troubleshoot the

Code: Select all

cpan -i RRD::Simpl
install issue(s).

Thanks
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: check_wmi_plus.pl -checkdrivesize no historic perf data

Post by gsmith »

Hey,

I can see the OS and PHP versions you are running...could you please tell me what rev of Nagios XI
you are running?

Thx
kgugerty
Posts: 42
Joined: Wed May 04, 2016 8:28 am

Re: check_wmi_plus.pl -checkdrivesize no historic perf data

Post by kgugerty »

Good Morning, below is the Nagios XI installation information.

Code: Select all

Nagios XI - System Info
System
Nagios XI version: 5.8.3
Release info: 4.18.0-193.19.1.el8_2.x86_64 x86_64
CentOS Linux release 8.2.2004 (Core)
Gnome is not installed
Apache Information
PHP Version: 7.2.24
Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36
Date/Time
PHP Timezone: America/Chicago
PHP Time: Tue, 03 Aug 2021 08:40:38 -0500
System Time: Tue, 03 Aug 2021 08:40:38 -0500
Nagios XI Data
Install Type: source

Nagios XI Components
actions	2.2.3
alertcloud	1.2.1
alertstream	2.1.1
autodiscovery	2.2.6
backendapiurl	1.0.5
bandwidthreport	2.0.2
bbmap	1.2.1
birdseye	3.2.4
bulkmodifications	2.3.0
capacityplanning	2.3.1
ccm	3.1.1
custom-includes	1.0.6
customlogin	1.0.0
customlogo	1.2.0
deploydashboard	1.3.2
deploynotification	1.3.4
duo	1.0.2
escalationwizard	1.5.1
favorites	1.0.1
freevariabletab	1.1.0
globaleventhandler	1.3.0
graphexplorer	2.3.0
helpsystem	2.0.1
highcharts	
homepagemod	1.1.11
hypermap	1.2.2
hypermap_replay	1.2.1
latestalerts	1.2.7
ldap_ad_integration	1.2.2
map	1.2.0
massacknowledge	2.2.2
massimmediatecheck	1.0.2
metrics	1.3.5
minemap	1.2.5
modgearmanxi	1
msp	1.2.0
mtr	1.0.3
nagiosbpi	3.0.3
nagioscore	
nagioscorecfg	
nagiosna	1.4.4
nagiosql	
nagvis	2.0.6
nocscreen	1.4.1
nrdsconfigmanager	1.6.9
nxti	1.0.4
opscreen	1.8.0
perfdata	
pingaction	1.1.2
pnp	
profile	1.4.1
proxy	1.1.5
rdp	1.0.5
rename	1.7.0
scheduledbackups	1.2.1
scheduledreporting	
similetimeline	1.5.1
snmptrapsender	1.6.2
statusmap	1.0.3
tracerouteaction	1.1.2
twilio	1.0.0
usermacros	1.1.0
xicore	
Nagios XI Config Wizards
activedirectory	1.3.5
ec2	1.1.3
s3	1.1.2
java_tomcat	1.1.0
autodiscovery	1.4.2
bpiwizard	1.1.5
bulkhostimport	2.1.3
capacity-planning	1.0.3
dhcp	1.1.7
dnsquery	1.1.6
digitalocean	1.0.4
docker	1.1.2
domain_expiration	1.1.8
email-delivery	2.0.6
esensors_websensor	1.1.7
exchange	2.0.1
ftpserver	1.5.8
folder_watch	1.0.7
genericnetdevice	1.0.5
java_glassfish	1.1.0
google-cloud	1.0.4
hyperv	1.0.2
java_jboss	1.1.0
json	1.0.0
java_jetty	1.1.0
ldapserver	1.3.5
linode	1.0.4
linux_snmp	1.6.0
linux-server	2.0.0
linux-server_legacy	1.6.0
mssql_database	2.0.3
mssql_query	1.7.0
mssql_server	2.0.3
macosx	2.0.0
mailserver	1.2.7
microsoft-azure	1.0.4
microsoft_365	1.0.1
mongodb_database	1.1.5
mongodbserver	1.1.5
mountpoint	1.0.4
mysqlquery	1.2.5
mysqlserver	1.3.5
ncpa	3.0.6
nrpe	1.6.0
nsclient	1.0.0
nagioslogserver	1.0.8
nna	1.0.8
nagiosxiserver	1.3.3
nagiostats	1.2.3
switch	2.5.4
oraclequery	1.3.9
oracleserverspace	1.5.9
oracletablespace	1.5.10
passivecheck	1.2.6
postgresdb	1.5.5
postgresquery	1.2.5
postgresserver	1.3.6
printer	1.1.5
radiusserver	2.0.4
rackspace	1.0.4
sla	1.3.4
snmp	1.6.5
snmp_trap	1.5.5
snmpwalk	2.0.1
sshproxy	1.5.9
solaris	1.3.3
tcpudpport	1.3.5
tftp	1.0.4
passiveobject	1.1.3
vmware	1.7.4
watchguard	1.4.7
webtransaction	1.2.7
java_weblogic	1.1.0
website	1.4.2
website_defacement	1.2.2
websiteurl	1.4.1
windowsdesktop	2.0.0
windowseventlog	2.0.2
windowssnmp	1.5.7
windowsserver	2.0.0
windowswmi	2.2.3
xml	1.0.0
Nagios XI Dashlets
alertcloud	
bbmap	
capacityplanning	
graphexplorer	
hypermap	
latestalerts	
metrics	
metricsguage	
minemap	
xicore_xi_news_feed	
xicore_getting_started	
xicore_admin_tasks	
xicore_eventqueue_chart	
xicore_component_status	
xicore_server_stats	
xicore_monitoring_stats	
xicore_monitoring_perf	
xicore_monitoring_process	
xicore_perfdata_chart	
xicore_host_status_summary	
xicore_service_status_summary	
xicore_comments	
xicore_hostgroup_status_overview	
xicore_hostgroup_status_grid	
xicore_servicegroup_status_overview	
xicore_servicegroup_status_grid	
xicore_hostgroup_status_summary	
xicore_servicegroup_status_summary	
xicore_available_updates	
xicore_network_outages	
xicore_network_outages_summary	
xicore_network_health	
xicore_host_status_tac_summary	
xicore_service_status_tac_summary	
xicore_feature_status_tac_summary	
availability	
custom_dashlet	1.0.7
gauges	1.2.2
googlemapdashlet	1.1.0
internettrafficreport	
rss_dashlet	1.1.5
sansrisingports	2.0
sla	
worldtimeserver	2.0.0
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: check_wmi_plus.pl -checkdrivesize no historic perf data

Post by gsmith »

Hi

Run this install:

Code: Select all

yum install rrdtool-perl
and then

Code: Select all

cpan -i RRD::Simpl
Give that a try please.

Thanks
kgugerty
Posts: 42
Joined: Wed May 04, 2016 8:28 am

Re: check_wmi_plus.pl -checkdrivesize no historic perf data

Post by kgugerty »

My apologies for the delay. We should be able to test this over the weekend. I will follow up with the results afterward.
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: check_wmi_plus.pl -checkdrivesize no historic perf data

Post by gsmith »

Hi there,

No problem - good luck.

Have a great weekend!
kgugerty
Posts: 42
Joined: Wed May 04, 2016 8:28 am

Re: check_wmi_plus.pl -checkdrivesize no historic perf data

Post by kgugerty »

rrdtool-perl is already installed and up to date on my system. I still receive the errors attempting to run

Code: Select all

cpan -i RRD::Simple
Locked