Nagios - How do you organise devices?

Associate
Joined
21 Apr 2011
Posts
99
Lots of Nagios tutorials refer to how to add one device...say for example switches.

So within /usr/local/nagios/etc/objects/switch.cfg you can define groups, hosts and services, though this is commented as a sample file for switches...

Do you put every switch in here, or have a separate cfg files within sub-folders for switches, servers, etc with lots of 'define_host' statements in one and 'define service' statements in the other?

Keen to hear the way others do it as I would like to start as I mean to go on and keep it organised and easy to maintain.

Ta :D
 
separate config files (same directory) for sites>devices (switch / routers / etc)
/usr/local/nagios/etc/objects/site-1-switches.cfg
/usr/local/nagios/etc/objects/site-1-switchuplinks.cfg
/usr/local/nagios/etc/objects/site-1-routers.cfg
/usr/local/nagios/etc/objects/site-1-routersuplinks.cfg
/usr/local/nagios/etc/objects/site-2-switches.cfg
/usr/local/nagios/etc/objects/site-2-switchuplinks.cfg
/usr/local/nagios/etc/objects/site-2-routers.cfg
/usr/local/nagios/etc/objects/site-2-routersuplinks.cfg

That sort of thing - then reference the config files in the main nagios.cfg file. My nagios is a bit rusty as I've not touched it for a while (one's it's in, it's in!)
 
separate config files (same directory) for sites>devices (switch / routers / etc)
/usr/local/nagios/etc/objects/site-1-switches.cfg
/usr/local/nagios/etc/objects/site-1-switchuplinks.cfg
/usr/local/nagios/etc/objects/site-1-routers.cfg
/usr/local/nagios/etc/objects/site-1-routersuplinks.cfg
/usr/local/nagios/etc/objects/site-2-switches.cfg
/usr/local/nagios/etc/objects/site-2-switchuplinks.cfg
/usr/local/nagios/etc/objects/site-2-routers.cfg
/usr/local/nagios/etc/objects/site-2-routersuplinks.cfg

That sort of thing - then reference the config files in the main nagios.cfg file. My nagios is a bit rusty as I've not touched it for a while (one's it's in, it's in!)

Thanks for this. So do you define hosts/uplink ports in those files along with host groups and the services you are checking?

Indeed I plan to get it up and running, and short of adding new devices, leave it be!
 
Back
Top Bottom