I have the exact same problem. I’m running OS X server 10.5.4 and nagios consistently hogs the CPU. I didn’t see this when I was running it on a Linux box. I have no strange plugins, and it’s the nagios command itself that is driving the CPU (so hard, in fact, that my box locked up last night). It’s been doing this for the last few weeks, ever since I initially setup the box.
Processes: 101 total, 3 running, 98 sleeping... 288 threads 09:57:17
Load Avg: 1.15, 1.31, 1.46 CPU usage: 20.73% user, 20.73% sys, 58.54% idle
SharedLibs: num = 2, resident = 73M code, 0 data, 5296K linkedit.
MemRegions: num = 8005, resident = 416M + 19M private, 126M shared.
PhysMem: 326M wired, 518M active, 52M inactive, 938M used, 1622M free.
VM: 5244M + 132M 121585(0) pageins, 0(0) pageouts
PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE VSIZE
1662 nagios 99.6% 23:01.44 2 32 26 256K 200K 912K 19M
1714 top 7.7% 1:50.26 1 29- 34 1136K 212K 1740K 19M
It’s dual 1.8GHz G5 with 2.5GB RAM. I really really love nagios and have been using it for years, but this is completely strange and I’ve never seen it before. There is nothing crazy in the logs. The only plugins I’m using are: check_{ping,disk,load,procs,users,swap,ftp,http,ssh,dhcp,fping,smb.sh,ircd,imap,smtp,pop}. The config is (almost) identical to what I had on my Linux box before. Stopping and restarting nagios doesn’t help; it immediately starts sucking up as much CPU as it can.
annvix:etc root# ps aux|grep nagios|grep -v grep
nagios 1662 98.1 0.0 76368 912 ?? Rs 9:33AM 26:36.37 /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg
nagios 1185 0.0 0.0 75488 484 ?? Ss 9:26AM 0:00.18 /sbin/launchd
nagios 317 0.0 0.0 75384 400 ?? S 9:06AM 0:00.01 /usr/bin/mail -s ** PROBLEM Host Alert: titan is DOWN ** vdanen_at_linsec.com
nagios 315 0.0 0.0 75944 708 ?? S 9:06AM 0:00.01 sh -c /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\nHost: titan\nState: DOWN\nAddress: 10.10.2.30\nInfo: (Host Check Timed Out)\n\nDate/Time: Fri Jul 25 09:06:24 MDT 2008\n" | /usr/bin/mail -s "** PROBLEM Host Alert: titan is DOWN **" vdanen_at_linsec.com
Sanitized the above somewhat due to the form wanting to replace my email address with some javascript nonsense.