Solved Complete server monitoring tool

joel.bodenmann

Member

Reaction score: 10
Messages: 87

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

Reaction score: 7,409
Messages: 29,985

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.
 
OP
OP
joel.bodenmann

joel.bodenmann

Member

Reaction score: 10
Messages: 87

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

Reaction score: 7,409
Messages: 29,985

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.
 

trumee

Active Member

Reaction score: 11
Messages: 138

Is there a Zabbix template which can report HDD temperature as reported by S.M.A.R.T?
 

ShelLuser

Son of Beastie

Reaction score: 1,715
Messages: 3,536

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

Reaction score: 7,409
Messages: 29,985

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

Reaction score: 7,409
Messages: 29,985

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

Reaction score: 225
Messages: 433

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

Reaction score: 7,409
Messages: 29,985

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
 
OP
OP
joel.bodenmann

joel.bodenmann

Member

Reaction score: 10
Messages: 87

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!
 

Bahadir

New Member


Messages: 6

You can try prometheu
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.
 

CyberCr33p

Active Member

Reaction score: 14
Messages: 181

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.
You use zabbix-agent in clients and not snmp, right?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,409
Messages: 29,985

Yes, agents are much more versatile than SNMP.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,409
Messages: 29,985

Monit is nice, not as feature rich as Zabbix but still good for some basic monitoring and automatic service restarts. The M/Monit server also works quite nice on FreeBSD. It's relatively cheap too and if I recall correctly it's a one-time pay for a life-time of support.
 

Phishfry

Son of Beastie

Reaction score: 1,302
Messages: 3,813

I was going to install Zabbix but I started looking at the requirements and they seem bulky.
Ngnix, PHP and MySQL
I want lightweight.
Does anything like that exist? A full data base seems excessive.
I messed with rrdtools and it was very lightweight so I know it's possible. Any suggestions?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,409
Messages: 29,985

I was going to install Zabbix but I started looking at the requirements and they seem bulky.
It's not that bad, but it's obviously going to depend on how many hosts you want to monitor and the amount of data from each host.

My home Zabbix server runs on a 4 core VM, gave it 24GB of RAM (most of it assigned to the database). At the moment I have 12 hosts (including my external VPS) monitored. The database itself is about 30GB at the moment and I have a couple of months worth of data in it.

I found something built on rrdtool called net-mgmnt/cacti that I will try.
Cacti is quite 'old-school'. It works nicely but is a bit of a pain in the posterior to configure. You really need to automate the creation of new hosts or devices.
 
Top