check_wmi_plus.pl Cannot determine local time zone

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
CBoekhuis
Posts: 234
Joined: Tue Aug 16, 2011 4:55 am

check_wmi_plus.pl Cannot determine local time zone

Post by CBoekhuis »

Hi,

A was requested to check the fileage of a file on a windows server.
Bij using the check_wmi.plus.pl (1.6) i get the message "Cannot determine local time zone" .
Here is the check as we run it:

Code: Select all

nagiosxi:root:/usr/local/nagios/libexec> ./check_wmi_plus.pl -H 192.168.1.1 -A /usr/local/nagios/libexec/check_wmi_plus.d/wmi_authentication_file -m checkfileage -a "d:/somedir/histdb.mdb" -d
Command Line (v1.6): ./check_wmi_plus.pl -H 192.168.1.1 -A /usr/local/nagios/libexec/check_wmi_plus.d/wmi_authentication_file -m checkfileage -a d:/somedir/histdb.mdb -d
Base Dir: /usr/local/nagios/libexec
Conf File Dir: /usr/local/nagios/libexec
Loaded Conf File /usr/local/nagios/libexec/check_wmi_plus.conf
Round #1 of 1
QUERY: /usr/bin/wmic '-A' '/usr/local/nagios/libexec/check_wmi_plus.d/wmi_authentication_file' '--namespace' 'root/cimv2' '//192.168.1.1' 'Select name,lastmodified from CIM_DataFile where name="d:\\somedir\\histdb.mdb"'
OUTPUT: CLASS: CIM_DataFile
LastModified|Name
20160622010033.855802+120|d:\somedir\histdb.mdb

COLUMNS(last index=1):LastModified|Name
Now looking for (.*?)\n (use_split=1)
FIELDS (via Split):COLNAME=LastModified,FIELD=20160622010033.855802+120
COLNAME=Name,FIELD=d:\somedir\histdb.mdb

Row Data Found OK
WMI DATA:$VAR1 = [
          [
            {
              '_ChecksOK' => 1,
              '_ItemCount' => 1,
              'Name' => 'd:\\somedir\\histdb.mdb',
              'LastModified' => '20160622010033.855802+120'
            }
          ]
        ];
Cannot determine local time zone
---------------------------------------------------------------------------------------------------------------------
Environment:
Nagiosxi 5.2.9
Centos 6.7 (Final)
On the windows server time zone is set to UTC +1,00 Amsterdam, nagios server on CEST , and al servers are in sync.

Any idea?

Regards,
Christian
Last edited by mcapra on Mon Jun 27, 2016 1:37 pm, edited 2 times in total.
Reason: Please use [code][/code] tags around terminal output
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check_wmi_plus.pl Cannot determine local time zone

Post by tgriep »

It looks like you found a known bug in the check_wmi_plus.pl script which was fixed in version 1.62.
Take a look at the changelog and upgrade to 1.62 if it is available.
http://www.edcint.co.nz/checkwmiplus/?q=Change%20Log
Be sure to check out our Knowledgebase for helpful articles and solutions!
CBoekhuis
Posts: 234
Joined: Tue Aug 16, 2011 4:55 am

Re: check_wmi_plus.pl Cannot determine local time zone

Post by CBoekhuis »

Hi,
i saw that too. But its in development. Hope this will be fixed soon.
When looking at the changelog dates it will take a while. :cry: :cry:

Regards,
Christian
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check_wmi_plus.pl Cannot determine local time zone

Post by tgriep »

You could try and upgrade the Perl DateTime module and see if that helps or not.

Code: Select all

cpan -i DateTime
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_wmi_plus.pl Cannot determine local time zone

Post by mcapra »

As @tgriep mentioned, there might be some problems with your perl environment. Specifically the DateTime module.

I went ahead and patched this plugin's checkfileage command. Seems to be functional against my testing Windows Server 2012 machine using any sort of timezone. I just used the UTC offset rather than defining actual timezones within DateTime. I make no claims that this will solve your issue, but you're welcome to give it a try (attached below).
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
https://www.mcapra.com/
CBoekhuis
Posts: 234
Joined: Tue Aug 16, 2011 4:55 am

Re: check_wmi_plus.pl Cannot determine local time zone

Post by CBoekhuis »

Hi,

i tested successfully mcarpa's check_wmi_plus.pl.
For me this works fine.

Thanx,

Regards,
Christian
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_wmi_plus.pl Cannot determine local time zone

Post by mcapra »

I'm glad this was able to solve your problem! Is it ok if we lock this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
CBoekhuis
Posts: 234
Joined: Tue Aug 16, 2011 4:55 am

Re: check_wmi_plus.pl Cannot determine local time zone

Post by CBoekhuis »

Sure.
For me it is solved. We will get the fix also with the 1.62 version of check_wmi_plus.

Kind regards,

Christian
Locked