I have to write a script which tries to ping a device, then if this device is not responsive for X days... then a mail is generated and the X days counter for the device is reset.
What would be the easiest way to achieve this? I was thinking of a CSV/XML file where I'd store the last day when the device was responsive and if X days has passed then a mail should be generated and the date will be reset.
Am I missing any obvious way to tackle this problem? I was also thinking about making a infinite loop where I am running pings every 1h and where I maintain all the devices in a hashtable.. but not sure about the consequences of running an infinite loop
thanks!