Check_fileage.vbs is plugin for nagios that uses NRPE_NT and works for Microsoft machines.
I tried to make it as flexible as posible, allowing nagios to pass simple but helpfull arguments.
I use it to find out for example what was the last antivirus definition update, I set if its older then 7 days warn if it is older then 10 critical. Although antivirus update is a centralized automated everyday task, many times admins stop worrying about it or just don’t have the time to keep checking. Well again nagios is here to save us!
The purpose is to check how old the file is compare to today (checks by LastModified Date)
‘Example of my use: get Last Time Antivirus MCAfee Enterprise (Version 8.0i) was Updated
IMPORTANT: PATHS MUST NOT CONTAIN SPACES, AND DOUBLE SLASHES, its a sad NRPE_NT argument passing problem, why developers didnt allow using quotes to separate arguments is something that I dont understand. Well I got around that, also the slashes must be doubled
Tip: use dir /ad /x and find the short path
‘Command example: check_av.vbs -f “C://PROGRA~1//COMMON~1//NETWOR~1//Engine//scan.dat” -w 10 -c 7
‘Command example: check_av.vbs -f “C:PROGRA~1COMMON~1NETWOR~1Enginescan.dat” -w 10 -c 7
‘check_av.vbs -f <File path and Location> -w <warning for days old> -c <Critical for days old>
‘NOTE: the -w -c are only triger if value is Higher then specified, if you put 2 it will only raise alarm on 3.
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -u -c check_fileage -a $ARG1$ $ARG2$ $ARG3$
service_description Antivirus Actualizado
command[check_fileage]=cscript.exe //nologo //T:90 c:nrpe_ntpluginsv2check_fileage.vbs -f $ARG1$ -w $ARG2$ -c $ARG3$