Hi!
I’ve install the AS400 plugin (sourceforge.net/projects/nas400plugin/ ) but I’ve a problem.
If I type this command from the shell:
it works fine: OK - Login completed successfully but from Nagios I’ve always the service in this status: Critical: (Service Check Timed Out)
This is from my commands.cfg file
define command{
command_name check_as400_login
command_line $USER1$/check_as400 -H $HOSTADDRESS$ -v LOGIN
}
This is my /usr/lib/nagios/plugins/check_as400 check_as400 file
USER=`cat /usr/local/nagios/libexec/.as400 |grep -e USER | cut -d = -f 2`
PASS=`cat /usr/local/nagios/libexec/.as400 |grep -e PASS | cut -d = -f 2`
/usr/lib/jvm/java-6-sun-1.6.0.22/jre/bin/java -cp /usr/local/nagios/libexec check_as400 -u $USER -p $PASS $*
And this is service command:
define service{
use generic-service
name as400-login
service_description LOGIN
notification_interval 0
check_command as400_login
host_name as400
}
Any ideas?
Thanks
luca
October 22, 2010, 4:54pm
2
when running from command line are you logged in as user nagios?
Va bene se ti rispondo in italiano che riesco a spiegarmi un pò meglio?
Intanto ho editato il mio primo post perchè avevo sbagliato a scrivere i percorsi ma la storia non cambia.
Quando lancio il comando manualmente sono collegato come root. Non riesco a collegarmi con l’utente nagios, mi riavvia il login… Anche provando con: su - nagios -c “/usr/lib/jvm/java-6-sun-1.6.0.22/jre/bin/java -cp /usr/local/nagios/libexec check_as400 -H IPas400 -u userAS400 -p passAS400 -v LOGIN” non mi da errori ma non mostra alcun risultato. Il server è Ubuntu 10.04
I permessi però li ho impostati per l’utente nagios, come gli altri check_xxx:
root@SUbuntu:/usr/local/nagios/libexec# ls -la
totale 4208
drwxrwxr-x 2 nagios nagios 4096 2010-10-22 22:53 .
drwxr-xr-x 9 root root 4096 2010-10-14 15:32 ..
-rwx------ 1 nagios nagios 28 2010-10-22 15:51 .as400
-rwxr-xr-x 1 nagios nagios 116652 2010-10-14 15:32 check_apt
-rwxr--r-- 1 nagios nagios 257 2010-10-22 15:50 check_as400
-rwxr-xr-x 1 nagios nagios 15327 2010-10-22 15:50 check_as400.class
-rw-r--r-- 1 nagios nagios 567 2010-10-22 15:50 check_as400_cmd_vars.class
-rw-r--r-- 1 nagios nagios 981 2010-10-22 15:50 check_as400_lang.class
-rwxr-xr-x 1 nagios nagios 2245 2010-10-14 15:32 check_breeze
-rwxr-xr-x 1 nagios nagios 131512 2010-10-14 15:32 check_by_ssh
lrwxrwxrwx 1 root root 9 2010-10-14 15:32 check_clamd -> check_tcp
-rwxr-xr-x 1 nagios nagios 91564 2010-10-14 15:32 check_cluster
Non capisco davvero, se riesci a darmi una mano ti ringrazio molto
davix12
October 23, 2010, 10:46am
4
Ok, I’ve solved it.
I’ve put username and password of the AS400 user directly in the chech_as400 file:
In this way everything works well.
Thanks to luca for the help!