Problems with xheck_dhcp, check_mysql and check_pgsql

hi to all
i’m using nagios 2.0b4 and the latest plugins (1.4)

in nagios log i found those entries

Service Warning[10-27-2005 18:03:51] SERVICE ALERT: www;PostgreSQL Running;WARNING;SOFT;2;(No output!) Service Warning[10-27-2005 18:01:01] SERVICE ALERT: www;MySQL Running;WARNING;SOFT;2;(No output!) Service Unknown[10-27-2005 18:00:41] SERVICE ALERT: router;DHCP Up;UNKNOWN;SOFT;2;Error: Could not bind socket to interface eth0. Check your privileges...

for DHCP is normal, because nagios user doesn’t have permission with eth0
is there a workaround ?

but for mysql and pgsql ?
how can i do ?

ps. running check_pgsql and check_mysql in command line, works fine :

nagios@xxx /usr/local/nagios $ ./libexec/check_pgsql -H 127.0.0.1 -l postgres -d template1 OK - database template1 (0 sec.)|time=0.000000s;2.000000;8.000000;0.000000

nagios@xxx /usr/local/nagios $ ./libexec/check_mysql -H 127.0.0.1 -u user -p mypassword
Uptime: 98030 Threads: 1 Questions: 672 Slow queries: 0 Opens: 7 Flush tables: 1 Open tables: 1 Queries per second avg: 0.007

how can i do ?

Try running those same commands after you have su - nagios.
I see now that you have run them as user nagios.
Perhaps it’s your command definition in checkcommands.cfg is not setup correctly.
Edited Thu Oct 27 2005, 09:45AM ]

# 'check_pgsql' command definition define command{ command_name check_pgsql command_line %USER1$/check_pgsql -d template1 -l postgres -H $HOSTADDRESS$ }

‘check_mysql’ command definition

define command{
command_name check_mysql
command_line %USER1$/check_mysql -u $ARG1$ -p $ARG2$ -H $HOSTADDRESS$
}

and then

# Define a service to check if PostgreSQL is running define service{ use generic-service ; Name of service template to use host_name www service_description PostgreSQL Running is_volatile 0 check_period 24x7 max_check_attempts 4 normal_check_interval 5 retry_check_interval 1 contact_groups admins notification_interval 960 notification_period 24x7 check_command check_pgsql }

define service{
use generic-service ; Name of service template to use
host_name www
service_description MySQL Running
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_interval 960
notification_period 24x7
check_command check_mysql!root!mysqlpall
}

oooooooooooooooooooooooooops

the error is %USER… instead of $USER…

ok, it works…

sorry :wink:

for dhcp you can use sudo or simply make check_dhcp available to everyone… i think there’s a thread strated when i had the same problem… try a search :wink:

Luca