PHP & MYSQL, Logging time a field stays the same
Posted: Wed Mar 09, 2011 10:27 am
I'm using a mysql database to hold data about network switch ports. The port status is collected and logged as a 1,2,3 for up/down/admin down. What I need to do is develop some php (or possibly perl) code to check the database for a ports status and log when one starts showing down, and then I THINK have a field that increments each time the port is down (it's a daily scan). This way I can set the ports for decomission if they're down for say 10 consecutive days. I'd also need to put in some code to remove the interface from the "down" table if it comes up or goes into admin down.
Any ideas on how to do the "consecutive days down" piece? I think I have a handle on the rest of it but I've never written anything that kind of logs a field's status this way.
Any ideas on how to do the "consecutive days down" piece? I think I have a handle on the rest of it but I've never written anything that kind of logs a field's status this way.