Check ports - NRPE portaudit check: Difference between revisions

From TykWiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 22: Line 22:
<pre>
<pre>
sudo /usr/local/etc/rc.d/nrpe2 restart
sudo /usr/local/etc/rc.d/nrpe2 restart
</pre>
'''Note:''' If this is the first time Portaudit (installed as a dependency) is used on the server, you need to download a fresh audit database before it will work. If you do not download it manually, it will happen automatically each night (called from periodic). To download a fresh audit database manually, run:
<pre>
sudo portaudit -F
</pre>
</pre>



Revision as of 10:57, 16 January 2010

It is possible to monitor servers for outdated or vulnerable ports using Nagios and NRPE:

$ cat /usr/ports/net-mgmt/nagios-check_ports/pkg-descr
Nagios Plugin to monitor your FreeBSD Ports Tree for updates or
installed packages with known security vulnerabilities.

Install the port:

sudo portmaster /usr/ports/net-mgmt/nagios-check_ports/

Add the following line to /usr/local/etc/nrpe.cfg:

command[check_ports]=/usr/local/libexec/nagios/check_ports


Remember to restart NRPE after changing the config:

sudo /usr/local/etc/rc.d/nrpe2 restart

Note: If this is the first time Portaudit (installed as a dependency) is used on the server, you need to download a fresh audit database before it will work. If you do not download it manually, it will happen automatically each night (called from periodic). To download a fresh audit database manually, run:

sudo portaudit -F

Define a service on the Nagios server, in /usr/local/etc/nagios/objects/services.cfg:

define service{
        use                             generic-service
        hostgroup_name                  freebsd-servers
        service_description             nrpe_check_ports
        check_command                   check_nrpe2!check_ports
}

I want all my FreeBSD servers to have their ports checked, so I added the hostgroup freebsd-servers to this check.