WMI - Cheking File age
WMI - Cheking File age
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
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
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?
- 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?
Former Nagios Employee
Re: WMI - Cheking File age
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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: WMI - Cheking File age
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
I even tried to create another similar check with another server and immediately saw the same issue
Re: WMI - Cheking File age
I spent lots of time trying to find a solution/workaround but no luck. Run the following command:
and upload the "debug" file that was generated. We will have to pass this to our developers.
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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: WMI - Cheking File age
Update the "iDeliver.txt" file, save it, open a PowerShell prompt, and run:
Compare the "LastModified" value to the date/time of your Windows box. Is it correct or it is one hour ahead?
Code: Select all
$select = 'Select name,lastmodified from CIM_DataFile where name="E:\\Scripts\\Temp\\iDeliver.txt"'
Get-WmiObject -Query $selectBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: WMI - Cheking File age
here you go
You do not have the required permissions to view the files attached to this post.
Re: WMI - Cheking File age
Can you also run the date command and post the output?
Former Nagios Employee
Re: WMI - Cheking File age
here you go
You do not have the required permissions to view the files attached to this post.