Running Python 2.6 and nagios-statd and getting socket errors?

home | blog | Teh Internet | guest blog |rants | placeholder | political | projects | Gwen and Liam | Citadel patched | Tools | Scouts

- Careful Chrome users, this search box might be "Not secure"

Notice: Don't follow the notes below, just install Python 2.4.6 and go to town as there seems to be issues with in the 2.6 release as of last nights tgz source release - that I grabbed on 8/27/09. With the old 2.4.6 nagios-statd is sailing along just fine!
To lazy to grab Python 2.4?
Here ya go: Python-2.4.6.tar.bz2
Debian and Ubuntu folks will need to also :
apt-get install build-essential
Don't forget to add the -a ip-of-nagios-server to the /etc/defaults/nagios-statd-server
Change the shebang line in nagios-statd from /usr/bin/python to /usr/local/bin/python - if you built defaults, and restart the service.

If you find that your nagios-statd is throwing socket errors on connect after running o.k. for a bit:

You might have an issue mentioned here:

It seems that an option went away in 2.6 that some code uses (it is apparently fixed in 3.0 and put in to Python's svn back in July 09):

For the impatient, here is the one line change:

Old version:
pid, status = os.waitpid(0, options=0)

pid, status = os.waitpid(0, 0)

So, the short of it is, replace your in your Python install.

How did I find the issue? Well, I just repointed stderr from the script to a file and restarted nagios-statd and waited for the condition to occur again. The script nagios-statd had the stderr pointed to /dev/null.

Ok, so it would seem that was not the fix! - Good luck getting it working again. The Python 3 series would require a bit of a re-write.

Looks like the Ubuntu folk have noticed this issue and have some evidence that it might be due to options of --bindto or --allowedhosts
Need to look at the code someday - probably at the same time I get around to fixing it for Python3!