need some help on configuring nagios on ubuntu 9.04

Joined
Feb 22, 2009
Messages
928
Hey Guys
needing some help on configuring other linux machines to get the services monitoring through nagios because right now localhost is only got the services getting checked and my other linux machines are not getting there services checked and I do have the NRPE plug in installed on my other linux machines.

also when I do this command /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg in putty I get this:

Warning: Host 'mail.xxxxx.com' has no services associated with it!
Warning: Host 'mail.xxxxx.com' has no default contacts or contactgroups defined!
Warning: Host 'server1' has no services associated with it!
Warning: Host 'server1' has no default contacts or contactgroups defined!


also I want notifications be sent from nagios but I have my mail server on a different machine then what nagios is on so how do I configure that?
 
you must have defined something somewhere or you wouldn't be getting errors :)


on my nagios install i have a cfg file for each host.

this is a debian install so yours may be different...


in the nagios dir i have a conf.d dir full of my service and host configs, if you don't it will be defined somewhere in the nagios.cfg (cfg_dir=)

a simpe host config file:

Code:
define host{
        use                     generic-host            ; Name of host template to use
        host_name               server1
        alias                   xxx
        address                 192.168.2.100
        parents                 xxx
        check_command           check-host-alive
        max_check_attempts      10
        notification_period     24x7
        notification_options    d,r
        contact_groups          admins
        }

then i have a services.cfg with for eg a check for http:

Code:
define service {
        hostgroup_name                  http-servers
        service_description             HTTP
        check_command                   check_http
        use                             generic-service
        notification_interval           1 ; set > 0 if you want to be renotified
}

and a hostgroups.cfg defining what machines are in the hostgroup http-servers:

Code:
define hostgroup {
        hostgroup_name  http-servers
                alias           HTTP servers
                members         server1,server2,server3
        }

using nrpe is slightly more complex

I am by no means a nagios wizzard, i just set up up privatly to monitor various things I have running, maybe someone with more of a clue can explain it better.

the mail thing...

IIRC, you can't tell nagios to use another machine (may have changed with v3 not sure) you would have to confgure an MTA locally to be a smart relay to the mails server.


hope that helped a little, there a tons of great guides to setup nagios, just google them
 
alright I finally got to work but now how can I get nagios to monitor routers? because I re-installed ubuntu 9.04 and how I installed nagios was sudo apt-get install nagios3 but when I look in directory of nagios of : /etc/nagios3/conf.d I dont see a cfg for switch or router so what I do now?
 
I just defined a host:

Code:
# a host definition for the gateway of the default route
define host {
        host_name   router
        alias       Default Gateway
        address     192.168.1.1
        use         generic-host
        }

and in my host groups added it the pingable servers and http-servers:

Code:
define hostgroup {
        hostgroup_name  http-servers
                alias           HTTP servers
                members         server,server1,router
        }

define hostgroup {
        hostgroup_name  ping-servers
                alias           Pingable servers
                members         server,server1,router
        }

and made sure i had services defined for the two:
Code:
define service {
        hostgroup_name                  ping-servers
        service_description             PING
        check_command                   check_ping!100.0,20%!500.0,60%
        use                             generic-service
        notification_interval           1 ; set > 0 if you want to be renotified
}

define service {
        hostgroup_name                  http-servers
        service_description             HTTP
        check_command                   check_http
        use                             generic-service
        notification_interval           1 ; set > 0 if you want to be renotified
}

nagios doesnt really care if its a router or a server or anything else (unless youre wanting to use nrpe then you need to be able to install the service) as long as the service you define is reachable, so for a router you prob want at least ping,shh and maybe http(s)
 
thanks for your help because I couldn't get any help over on ubuntu forums about these questions at all.
 
Back
Top