Nagios in a VM

Whooppeee. Got one going.
There was a virtual appliance for VMWare, but I don’t use VMWare so rolled my own in VirtualBox.

Did a minimal install of FC11, which took no time at all as I couldn’t find the blasted DVD so used VirtualBox network boot of the VM to get a MAC address and added it to my dhcpd network boot config, and did an interactive install over the network.

I installed the minimum packages I could, still too many; but at least managed to leave out all X components I could.

I had downloaded the source from the nagios site but though I’d try a ‘yum search nagios’, gosh it was there.
I still had to install all the gcc and gd libraries through yum, but after that installing the nagios packages through yum as well was a breeze.

Checked the config files, customised the main one as in the nagios quick start guide, started httpd and tried to browse the VM. Failed !. SSH worked into the VM though. Eventually remembered the supplied firewall rules with FC11 block http inbound traffic.
Ooops, no X installed to easily configure the firewall. Copied across the (guarddog configured rc.firewall) firewall config script from my dev server and ran that; note to self create a custom one for this VM. And then http access was available.
Of course Nagios didn’t work until I ran the startup script in init.d, didn’t even know it put one there from the doco.

Anyway, full localhost monitoring. Not what I wanted (although pretty), I want to monitor all my other servers from the VM.

Haven’t figgured out the config scripts yet. Created a hosts.cfg in objects that was totally ignored.
So then instead changed the objects/localhost.cfg to include two other servers host definitions, added them to the host group, and set the checks for ping, http and ssh to use the hostgroup (guess I need to research the nrpe stuff to setup swap/filesystem etc monitoring) and that worked. Hostgroup had three servers, detected when one was down, http down on one etc.

So works well, I will spend time learning how to use this one.
Wonder if there is a selinux ruleset for it ?, I did the chcon in the quickstart to get the scripts running but while that runs the scripts selinux is preventing directory/file searches so there was always a couple of errors at the top and bottom of each page saying permission denies searching for the ssi customised headers and footers. No biggee, it’s a VM, I turned selinux off.

My only problem is going to be (when I figure out the config fies) trying to stop myself writing customised plugins for all my apps. I have too much to do alredy :-).

And of course make sure I can convert from VDI disk images to QCOW and run them under QEMU, where did I put that damn script I spent days on that automated that ?.

About mark

At work, been working on Tandems for around 30yrs (programming + sysadmin), plus AIX and Solaris sysadmin also thrown in during the last 20yrs; also about 5yrs on MVS (mainly operations and automation but also smp/e work). At home I have been using linux for decades. Programming background is commercially in TAL/COBOL/SCOBOL/C(Tandem); 370 assembler(MVS); C, perl and shell scripting in *nix; and Microsoft Macro Assembler(windows).
This entry was posted in Unix. Bookmark the permalink.