![]() You need to create the script that monit will call when it raises an alert. Take a look at the monit man page for more details about what you might want to change. ![]() You can edit the nf file in /etc but the default values are fine. # chkconfig monit on & service monit start Set monit to start on boot and start monit. You will need both these keys to have monit be able to ping Pushover via the alert script. You need to record the new application API Token/Key as well as your Pushover User Key (you can find this on the main pushover page if you are logged in). It is nice though having an icon when you get a message. If you want you can add an icon, but you don’t need to do this.Add a description (I called it Monit Server Monitoring).Give the application a name (I called it Monit), but you call it anything you like.This will open the Create New Application/Plugin page. Setting up PushoverĪfter registering an account at Pushover, and downloading the appropriate app for your phone (iOS or android), you need to set up a new pushover application on the Pushover website.Ĭlick on Register an Application/Create an API Token. I did all this logged in as root, but if you don’t like to live on the edge just put sudo in front of every command. After a bit of experimentation I got the whole system running rather nicely. This alert script is set to only be called if monit cannot fix the problem by restarting the service. Luckly, monit can also execute scripts so I settled on the alternative approach of calling the Pushover API via an alert script that would pass through exactly what server and service was having problems. Most of our servers don’t have the ability to email (they are slimmed down and are only running the services needs to support PeakTrace). ![]() The only issue with integrating monit and pushover is that by default monit is set to email alert notices. It comes with a 7 day free trial so you have time to make sure everything is going to work with your system before paying. It has lots of other nice features like quiet times and group notification. For a one off cost of $5 you can use the Pushover API to send up to 7500 message a month to any phone. I also wanted a service that would ping my phone, but where I could easily control it (i.e turn on/off, set away times, etc). For example, if the server can be fixed by simply restarting apache then I want the monitoring service to just do this and only send me a message if something major has happened. The great thing about monit is that you can set it up to fix things on its own. Monit is an open source watchdog utility that can monitor other Linux services and automatically restart them if they crash or stop working. After looking around all the paid services I settled on using a combination of Monitand Pushover. While the Auto PeakTrace RP application is designed to be robust in the face of server downtime, I wanted a dead simple monitoring service that would fix 99% of the server problem automatically and only contact me if there was something really wrong. For historical reasons these servers are a mix of CentOS 6/7 VPS and physical servers supplied by three different companies. My company Nucleics has an array of servers distributed around the world to support our PeakTrace Basecaller. It is possible to get instant notification by using pam_exec, but that is another post. The only downside is that notification takes around a minute to occur since the notification is only pushed once monit checks the secure logfile. Now anytime someone logs in to the server you will be sent notification. If everything is fine then restart monitoring by reloading the new. # nano /var/conf file are correct # monit -t your own) then create a text file with the list of IP address to be ignored (one per line). If you want to be able to ignore logins from certain IP addresses (i.e. If match "Accepted password" then exec "/usr/local/bin/pushover.sh" If match "Accepted publickey" then exec "/usr/local/bin/pushover.sh" #Ignore login's from whitelist ip addresses # nano /etc/monit.d/ssh_nfĬheck file ssh_logins with path /var/log/secure ![]() If you already have set up a Monit and Pushover system then this just requires adding of an extra nf file.Ĭreate the ssh logins monit. I wanted to be able to see who is logging into my servers and be notified if anyone not authorised gained access. Following on from my earlier post on how to set up Dead simple CentOS server monitoring with Monit and Pushover, I recently added monitoring for ssh logins.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |