#4325 [easyfix] add new machines to nagios
Closed: Fixed None Opened 10 years ago by kevin.

Several folks could work on the various parts of this. ;)

We need to add some new instances recently spun up to nagios...

  • sundries: sundries01/02/01.stg

  • wiki: wiki01/02/01.stg


Opening up so other apprentices can take a crack at Nagios.

Could someone post what the parents need to be set to for these machines?

You can look at: /var/log/virthost-lists.out on lockbox01.

There's a script that runs every hour and collects that information and puts it in that log file. You can see virthost:guest in there for all virthosts and guests. ;)

Well, as promised, i have now Nagios up and running on my little lab at home. I have it running on one fedora machine, and it monitors itself and another fedora machine.

For this ticket i found this (following kevin's advice):

[henderbj@lockbox01 plugins]$ cat /var/log/virthost-lists.out | egrep -i sundries01
virthost03.phx2.fedoraproject.org:sundries01.phx2.fedoraproject.org:running:1
virthost12.phx2.fedoraproject.org:sundries01.stg.phx2.fedoraproject.org:running:1
[henderbj@lockbox01 plugins]$

From there we see that sundries01 resides on virthost03 and sundries01.stg resides on virthost12.

For the rest we can do the same and find their hosts.

I know i must configure NRPE on the "to be monitored" machine, and create a configuration file for that machine in the monitoring machine (I thought it was admin.fedoraproject.org, but are several, noc01.fedoraproject.org being one of them).

My next step is find out how are configured others guests on fedoraproject's nagios and make a similar setup for our new guests.

If someone have some ideas, please share.

For current config, you will want to login to lockbox01, then 'git clone /git/puppet' and look under puppet/modules/nagios/files/nagios/

you can login to noc01 and look at /etc/nagios for the way they are setup on the monitoring host (noc01 is our main nagios monitoring host).

Feel free to ask questions about the setup here or on irc.

I followed kevin's advices on last comment, and right now i have the puppet directory on lockbox01.

Looking at it, i observe that on puppet/modules/nagios/files/nagios/ directory i have the configuration that is on monitoring side (noc01, for example).

I can see how lockbox01 was configured reading the /etc/nagios/nrpe.cfg file on it, giving me the monitored part configuration (but for lockbox01). However, i need to know which services to monitor in each one of the new "to be monitored" servers.

So, it's a bit tricky, but if you look in modules/nagios/files/nagios/hostgroups/servers.cfg you can see the servers hostgroup is: * and then !a few others. Basically by default hosts are in the 'servers' group and get all the regular server monitoring. ;) That should be fine for these servers.

I was about to ask which nrpe.cfg (from puppet) is the one i must edit to make it finally be on /etc/nagios/nrpe.cfg (on target server). I searched for the string "/etc/nagios/nrpe.cfg" in all the files under puppet and found the nrpe class on puppet/modules/nagios/manifests/init.pp file:

...
service { 'nrpe':
enable => true,
ensure => running,
subscribe => File['/etc/nagios/nrpe.cfg']
}

file { '/etc/nagios/nrpe.cfg':
    source => 'puppet:///nagios/nrpe.cfg',
    require => Package[nrpe],
    # notify  => Service[nrpe]
}

...

From there i see that the file to edit is puppet/modules/nagios/files/nrpe.cfg.

EDIT: This latter file was not edited at all.

New hosts files, to be extracted under puppet/modules/nagios/files/nagios/hosts/ directory
new-hosts.tar

Changes to configuration has been added as attachments. Please review them and indicate if any other change is needed.

I assigned this ticket to myself, but certainly i must wait now for someone with write access to puppet to review and apply changes or indicate problems for new changes.

Cool. That looks pretty good.

1 issue:

  • You need to also add a modules/nagios/files/nagios/hosts/<name>.cfg for each new host. Look at the other hosts in that dir for the format. nagios needs this to define the host.

Can you add that and re-attach?

It is already attached.

Please see the file: new-hosts.tar​.

Inside it are those <hostname>.cfg files. :)

Thanks much!

Applied. :)

Login to comment on this ticket.

Metadata