• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Solved Complete server monitoring tool

joel.bodenmann

Member

Thanks: 5
Messages: 57

#1
Hello folks,

I'm currently looking for a solution to monitor my FreeBSD servers/hosts. I'd like to have a utility that allows me to monitor multiple FreeBSD hosts remotely (eg. via a web interface). I've searched the interwebs and it appears that there are plenty of utilities available for Linux but not that many for FreeBSD.
Here's a list of my requirements:
  • Full support for FreeBSD
  • Monitor the host itself (CPU, memory, disk, network, ...)
  • Monitor services
    • NGINX
    • MySQL
    • PF (that would be awesome!)
  • Graphical interface (web interface is fine)
Optionally:
  • Self hosted
  • Not too pricey (up to 10 USD per month per host would be acceptable)

Do you guys have any recommendations? What do you use? One of the most promising so far has been ServerDensity. However, I realized that their NGINX plugin only works on FreeBSD for NGINX+ customers (which I am not). The non-plus plugin only works on Linux.

Any kind of tip, feedback or general information that might help here would be greatly appreciated.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,994
Best answers: 10
Messages: 26,759

#2
I've searched the interwebs and it appears that there are plenty of utilities available for Linux but not that many for FreeBSD.
Pretty much everything that runs on Linux also runs on FreeBSD. You really don't need to look for something FreeBSD specific.

Here's a list of the popular ones:
net-mgmt/nagios
net-mgmt/zabbix32-server
sysutils/munin-master
sysutils/monit (needs a server; you have to pay for it. But it's fairly cheap and you get a lifetime of updates)

This list is by no means complete. It's just a number of the more popular ones.
 

joel.bodenmann

Member

Thanks: 5
Messages: 57

#3
Thanks a lot for your reply.

When I understand correctly, sysutils/monit only monitors the host itself (CPU, memory, ...) but it can't monitor services running on that host such as a web server or a database server. Is that correct?
Then again, I'm not sure whether I really need that. I run a couple of web servers for various IT projects. It's nothing really big or absolutely mission critical. But just having the machine performance stats doesn't appear to be worth the effort. After all the physical machine can be completely fine but the web server might have crashed or similar. Any thoughts or experiences you could share on this topic?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,994
Best answers: 10
Messages: 26,759

#4
When I understand correctly, sysutils/monit only monitors the host itself (CPU, memory, ...) but it can't monitor services running on that host such as a web server or a database server. Is that correct?
No, that's not correct. We use it to monitor all sorts of things. The monitrc allows for a lot of customization.

After all the physical machine can be completely fine but the web server might have crashed or similar. Any thoughts or experiences you could share on this topic?
Besides Monit we also use Zabbix. I've created a whole bunch of templates to monitor just about every available metric on HAProxy, Apache and MySQL.
 

ShelLuser

Son of Beastie

Thanks: 1,185
Best answers: 5
Messages: 2,552

#6
Another suggestion would be sysutils/webmin. It isn't particularly a monitor but it does provide support for that (fully customizable). Webmin is basically an administative tool with a web interface, which supports Linux, Solaris and BSD.

Which makes it a suitable candidate too (in my opinion) because it doesn't only monitor: it would also allow you to apply changes or such when something needs to be (re)configured.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,994
Best answers: 10
Messages: 26,759

#7
It's relatively easy to create your own templates. Simple example:
Code:
UserParameter=system.pkg,/usr/local/etc/zabbix22/scripts/check-pkg.sh
check-pkg.sh:
Code:
#!/bin/sh

pkg version -qvRl'<' | grep '<' | wc -l
Using this I can read system.pkg in Zabbix. The script simply returns the number of out-of-date packages and I have created a trigger to alert if this value isn't 0.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,994
Best answers: 10
Messages: 26,759

#9
Good choice, can't go wrong with it. I have an rc(8) script for the M/Monit server part if you need it.
 

sko

Well-Known Member

Thanks: 156
Messages: 334

#10
While Nagios is quite powerful and flexible it is also rather ancient and the configuration and how it is structured is a complete mess. I'm stuck with it here, but I wouldn't recommend building a new monitoring infrastructure with Nagios unless you have very special needs only Nagios can meet (if such needs even exist...).

As said: practically any monitoring solution available on linux is also available for FreeBSD.
If you are already using SNMP for monitoring, Cacti might be worth a look.
For an "jack of all trades" solution you could also take a look at Spiceworks. I only skimmed over it when I was evaluating possible replacements for Nagios, but for our needs this was complete overkill (althogh it has pretty nifty features...).
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,994
Best answers: 10
Messages: 26,759

#13
M/Monit:

Get the server part: https://mmonit.com/download/

Extract to /usr/local/: tar -C /usr/local -zxvf mmonit-<X.X.X>-freebsd-x64.tar.gz
Create a symlink: ln -s /usr/local/mmonit-<X.X.X> /usr/local/mmonit
The symlink allows you to keep the old versions and switch back in case of problems. Edit /usr/local/mmonit/conf/server.xml, setup the database, add license etc. If you're upgrading from a previous version make sure to follow the upgrade procedure (the upgrade procedure will automatically copy/convert the configuration).

/usr/local/etc/rc.d/mmonit:
Code:
#!/bin/sh

# PROVIDE: mmonit
# REQUIRE: DAEMON
# KEYWORD: shutdown

#
# Add the following line to /etc/rc.conf to enable M/Monit
#
# mmonit_enable="YES"

. /etc/rc.subr

name=mmonit
rcvar=mmonit_enable

load_rc_config "$name"

: ${mmonit_enable:="NO"}

command="/usr/local/mmonit/bin/mmonit"
command_args=""
start_precmd="mmonit_checkconfig"
stop_cmd="mmonit_stop"
start_cmd="mmonit_start"

mmonit_checkconfig () {
        echo "Performing sanity check on M/Monit configuration:"
        eval ${command} ${mmonit_flags} -t
}

mmonit_start () {
        echo "Starting M/Monit:"
        eval ${command} ${mmonit_flags} start
}

mmonit_stop () {
        echo "Stopping M/Monit:"
        eval ${command} stop
}

run_rc_command "$1"
Enable: sysrc mmonit_enable="YES"
Start: service mmonit start
 

joel.bodenmann

Member

Thanks: 5
Messages: 57

#14
Thanks a lot Sir, much appreciated!

I have tested monit a couple of days now and it looks like that is exactly what I have been looking for. The server costs are more than just reasonable as well. Thanks a lot for this great recommendation!
 
Top