Translations: English
Search on Docs:
ActionItem Search:

Nagios Monitoring for Noosfero

Install Nagios server

# aptitude install nagios3 nagios-nrpe-plugin libapache2-mod-php5
remember the admin password you will set at the Nagios debconf dialog.

If you want to send commands to Nagios from it's web interface, set check_external_commands=1 at /etc/nagios3/nagios.cfg. And make the cgi executable:
# adduser www-data nagios
# chmod g+rx /var/lib/nagios3/rw
# chmod +x /var/lib/nagios3/rw/nagios.cmd

Update /etc/nagios3/conf.d/contacts_nagios2.cfg with your identity:
define contact{
        contact_name                    ze
        alias                           Joze
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,r
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email

define contactgroup{
        contactgroup_name       admins
        alias                   Nagios Administrators
        members                 ze

Add your servers config files at /etc/nagios3/conf.d. Example:
define host{
        use                     generic-host            ; Name of host template to use
        alias                   My-Noosfero
        address                 111.222.333.444
        contact_groups          admins

define service{
        use                             generic-service         ; Name of service template to use
        service_description             has_delayed_job
        check_command                   check_nrpe_1arg!has_delayed_job
(and other service tests...)

Add Nagios to some vitualhost in SSL

<VirtualHost *:443>
  ServerName your-server.some.where
  Include /etc/nagios3/apache2.conf

Nagios is alive at: https://your-server.some.where/nagios3 User:=nagiosadmin=

New users must be added to /etc/nagios3/htpasswd.users and their permission set in cgi.cfg.

Install Nagios Client in your Noosfero server

# aptitude install nagios-nrpe-server nagios-plugins

Update /etc/nagios/nrpe.cfg to:

You'll need to set new command tests at /etc/nagios/nrpe_local.cfg:
command[check_all_disks]=/usr/lib/nagios/plugins/check_disk -w '20%' -c '10%' -e

Create /usr/local/bin/has_delayed_job:

num=$(ps aux | grep 'noosfero .* [d]elayed_job' | wc -l)

case $num in
  0) $dummy 2 'There is no delayed_job proc';;
  1) $dummy 1 'There is only one delayed_job proc';;
  *) $dummy 0 "There are $num delayed_job procs";;
…and make it executable.

If you add/change something, reload the service:
# service nagios-nrpe-server restart

Add comment
You need to login to be able to comment.
Topic revision: r1 - 24 Apr 2017, UnknownUser

irc Talk with Devs Now!

Copyright © 2007-2019 by the Noosfero contributors
Colivre - Cooperativa de Tecnologias Livres