Image

Imagemuerte wrote in Imagelinux

Linux Time-out?

I'm using MRTG to do some network monitoring and I've written several custom (Perl) plugins for it that are working great. Well mostly great. When a certain task runs for too long it stalls MRTG and causes it to not update anything. Basically every 5 minutes MRTG does an SSH login to a remote box, runs a single command, and then exits. Is there a way to set a timeout value on a specific check? It would be great to be able to say, login and run this command, if it hasn't returned in 30 seconds cancel the connection.

What's happening is there are some log files that are getting HUGE and sometimes it takes massive amounts of time to parse them. I don't want MRTG to cause unnecessarily high load on the box while it crunches the log file. Any ideas how I can impose a time-out value on this?