
- #Monit web port how to
- #Monit web port password
Here is what the Monit configurations essentially do for each media server service Logo by mountdesign.Use Monit to Monitor Linux Home Media Server At some point I'll make it do more extensive testing for Minecraft and SyncThing, but this gets me 90% of what I wanted:Ĭheck host localhost with address Ĭheck host with address Ĭontact To respond to this post, send me an email at the extent possible under law, Brendan Long has waived all copyright and related or neighboring rights to this work. I made it quieter by adding for 3 cycles to that rule. In my case, the connection to my SMTP server would randomly fail, but it doesn't really matter as long as a retry works. You probably want to set fault tolerance for some rules.You can do more complicated checks with send and expect (send a text or binary message and check the response). If you don't set protocol, it will just test if a TCP connection succeeds.See the syntax in the documentation for the correct order. For example, protocol http status 200 content = "Brendan Long" is valid, but protocol http content = "Brendan Long" status 200 is not. For HTTP, you can give the expected status and text that should be in the response with content.
#Monit web port password
For protocols that have logins, you can give a username and password and it will test if the login succeeds. If you tell it the protocol, it will ensure that the endpoint not only connects, but gives a reasonable response. It supports all of the major protocols like HTTP(S), SMTP(S), IMAP(S), etc. If you're testing one of the supported protocols, add a protocol section. The part I had the most trouble with was figuring out the rules. I got around this by naming it "localhost" instead of "". The unique name part is annoying, since Monit creates a rule for your server automatically, and you can't add to it (as far as I can tell - email me if this isn't true). To do that, I used check host rules exclusively.Ĭheck host with address I don't care what processes are running or what files exist, I just want to sure that you can get the correct pages from each HTTP server and the other servers are responding in reasonable ways. Monit can check a lot of things like processes and system health, but I'm a believer in checking the thing you actually care about. To write these config files, refer to the Monit documentation. This is just personal preference, but it will be easier to handle package updates this way, and I should be able to find things faster. For example, monitoring of things accessed at "" is in a file named /etc/monit.d/ and is in /etc/monit.d/. I put the rest of my configuration in individual files in /etc/monit.d. section, where I changed the admin password and removed the localhost restriction (so I can access it remotely at ). The only other thing I changed in this file is the set httpd port. I also uncommented the eventqueue lines so alerts won't be lost if the mail server goes down. Set alert you're using a remote mail server, you probably need to configure a user name and password. I chose Monit because it's easy to setup (see next) and the barebones UI doesn't matter to me (I just want a basic up/down status and emails). I looked at Sensu too, and it seems nicer but still overkill. I've worked with sysadmins in the past who liked Nagios, so that was my first choice for this, but it's complicated to set up and extreme overkill for monitoring one server. A separate server really would be ideal, but since I can't run it from home (ISP port filtering blocks SMTP), I'd have to pay for another VPS, and it doesn't seem worth it right now. A bigger problem is that I'm not testing the firewall rules and routing. If the entire server is down I'll probably notice eventually. The obvious question is "who monitors the monitor?", but my main concern is not noticing services I don't use. My use-case is one server monitoring itself. #Monit web port how to
I figured other people might want some examples of how to use it, so this post describes how to set it up and you can see my config file at the end. After some research, Monit was relatively easy to set up and seems to meet my needs. After breaking several of them and not noticing (again), I decided to finally set up service monitoring. This machine runs a lot of services and I don't use all of them.