Page 1 of 2
WMI - Cheking File age
Posted: Wed Nov 04, 2015 2:21 pm
by bosecorp
I am trying to get the file age for a file in couple windows servers but is not working. this is the error I get
root@nagmonus1:(11-04 13:44): /root
# /usr/local/nagios/libexec/check_wmi_plus.pl -H myservername.bose.com -u 'myusername' -p 'mypassword' -m checkfileage -a "E:/Scripts/Temp/iDeliver.txt" -c 15min
CRITICAL - [Triggered by _FileAge<0] - Age of File E:/Scripts/Temp/iDeliver.txt is -3114 or -0.86hr(s).|'E:/Scripts/Temp/iDeliver.txt Age'=-0.86hr;0.25;
I checked the file and is less than 15 min old
this was working fine, but stopped working after this past sunday
Re: WMI - Cheking File age
Posted: Wed Nov 04, 2015 5:58 pm
by rkennedy
This could be a few different things so I'd like to do some digging -
- Can you verify the time on both your Nagios server, and the remote windows server are in sync time wise?
- What happens if you run the check_wmi_plus local on the Windows machine?
- Lastly, what version of XI are you running?
Re: WMI - Cheking File age
Posted: Wed Nov 04, 2015 5:59 pm
by lmiltchev
I was able to recreate the issue. I am not sure what is causing it but I suspect it's the daylight savings. I would recommend rerunning the check in an hour to see if you are going to get the same output. Meanwhile, we will do some more digging into this.
Re: WMI - Cheking File age
Posted: Wed Nov 04, 2015 7:43 pm
by bosecorp
You are right. it happened after Sunday, which is when the hour change. I can tell you that waiting will not help. the alert has been there since Sunday and has not gone away since then.
I even tried to create another similar check with another server and immediately saw the same issue
Re: WMI - Cheking File age
Posted: Thu Nov 05, 2015 12:42 pm
by lmiltchev
I spent lots of time trying to find a solution/workaround but no luck. Run the following command:
Code: Select all
/usr/local/nagios/libexec/check_wmi_plus.pl -d -H myservername.bose.com -u 'myusername' -p 'mypassword' -m checkfileage -a "E:/Scripts/Temp/iDeliver.txt" -c 15min > debug
and upload the "debug" file that was generated. We will have to pass this to our developers.
Re: WMI - Cheking File age
Posted: Thu Nov 05, 2015 1:05 pm
by bosecorp
here you go
Re: WMI - Cheking File age
Posted: Thu Nov 05, 2015 2:41 pm
by lmiltchev
Update the "iDeliver.txt" file, save it, open a PowerShell prompt, and run:
Code: Select all
$select = 'Select name,lastmodified from CIM_DataFile where name="E:\\Scripts\\Temp\\iDeliver.txt"'
Get-WmiObject -Query $select
Compare the "LastModified" value to the date/time of your Windows box. Is it correct or it is one hour ahead?
Re: WMI - Cheking File age
Posted: Thu Nov 05, 2015 3:45 pm
by bosecorp
here you go
Re: WMI - Cheking File age
Posted: Thu Nov 05, 2015 3:50 pm
by rkennedy
Can you also run the date command and post the output?
Re: WMI - Cheking File age
Posted: Thu Nov 05, 2015 3:51 pm
by bosecorp
here you go