hello, I can monitor processes (as apache2 or mysql), but how can I auto-restart one of them if it is down ?
Thank you for your answers.
autorestart a process if it is down
Moderators: Developers, Moderators
-
- Posts: 7
- Joined: Thu Sep 25, 2008 8:46 am
autorestart a process if it is down
- Attachments
-
- apache-log.JPG (28.85 KiB) Viewed 1115 times
Hi chrisduplateau,
I would not recomend you to do this with cacti.
It is not impossible, but it would be like teaching a dog to write a book.
There are several other tools out there that can do this type of thing.
For example Nagios can monitor and restart services. But for small deployments i would recomend moint (http://mmonit.com/monit/). I haven't used it myself, but it made a good impression when i saw it in an presentation.
And I have to add. If your apache crashes as fequently as this graph shows, you have most likely other problems, that a restart script won't solve.
I would not recomend you to do this with cacti.
It is not impossible, but it would be like teaching a dog to write a book.
There are several other tools out there that can do this type of thing.
For example Nagios can monitor and restart services. But for small deployments i would recomend moint (http://mmonit.com/monit/). I haven't used it myself, but it made a good impression when i saw it in an presentation.
And I have to add. If your apache crashes as fequently as this graph shows, you have most likely other problems, that a restart script won't solve.
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan
-
- Posts: 7
- Joined: Thu Sep 25, 2008 8:46 am
Thank you fo your answer, in fact my apache2 does not crash as we can see on the graph, I sometimes have "gaps", I don't get informations, (it's also true for other monitorings like CPU usage, memory usage...). I don't know why I get those gaps, I perhaps should post a topic in this forum !
I'm gonna see other tools, thanks.
I'm gonna see other tools, thanks.
Check in Cacti console -> device -> availability. If its low increase the timeout to the device or check the device's SNMP capability.chrisduplateau wrote:Thank you fo your answer, in fact my apache2 does not crash as we can see on the graph, I sometimes have "gaps", I don't get informations, (it's also true for other monitorings like CPU usage, memory usage...). I don't know why I get those gaps, I perhaps should post a topic in this forum !
I'm gonna see other tools, thanks.
Otherwise.. it is an ongoing topic in Cacti. Look for keyword "gaps" in a search. Some tricks that usually work is to increase the processes <cmd.php poller> or threads <spine poller>. When your installation gets bigger you need more tricks.
Regards
-
- Posts: 7
- Joined: Thu Sep 25, 2008 8:46 am
Happy to help. Also, the developers are really excellent at providing information back. But.. it's their hobby, give them time to respond if you need an answer back.chrisduplateau wrote:Many thanks, I'm gonna search in the forum (good availability for all my machines)
BTW, for your graph you may want to increase the width to 530 or 550 so it will fit on the page.
graph management -> keyword search or filter by host -> select graph -> change width from 500 to 530 or 550. save.
Who is online
Users browsing this forum: No registered users and 7 guests