[Nagiosplug-help] postgresql version of check_nagios_db.pl?

Mike Patterson mpatters at cs.uwaterloo.ca
Wed Aug 18 22:15:12 CEST 2004


Hi, I'm trying to get nagios running on a FreeBSD box with postgres. 
Installing the ports for nagios and the plugins went fine, and I muddled 
my way through creating the appropriate tables and such.

Where I'm blocked is at getting nagios to check its own status; ie, the 
web interfaces say "monitoring may be down".  I eventually figured out I 
probably needed contrib/check_nagios_db.pl, and modified it to suit 
FreeBSD's directory structure.

However, the script seems to be MySQL-centric, in that it uses a 
function UNIX_TIMESTAMP that doesn't exist in PostgreSQL.  I figured out 
how to add the missing function, and the actual SQL call works.  But 
running the perl script says:

(localhost, 5432, nagios, NAGIOSPASSWORD, nagios)
DBI connect('database=nagios;host=localhost;port=5432','nagios',...) 
failed: (no error string) at ./check_nagios_db.pl line 54

which doesn't strike me as being very useful.

I can't be the only person in the world trying to do this, but google 
was very unhelpful.  It's been a couple of years since I had to do much 
with writing perl to talk to postgres, and I'd never used the DBI 
interface, so I assume it's something stupid that I'm doing.  I'm hoping 
that somebody will just say "Mike, you idiot, you just have to x," so... 
I won't mind the names if the answer works.  :-)

Thanks,

Mike





More information about the Help mailing list