Hi, we have defined the host "ROZAS-SAI-AUDITORIO" in the file " hosts.cfg ", the following command "check_ups" in the file " commands.cfg " and the next service "Ups Alarm" in the file " services" :
define host{
use generic-switch
host_name ROZAS-SAI-AUDITORIO
alias ROZAS-SAI-AUDITORIO
address 192.168.2.31
hostgroups ROZAS
}
define command {
command_name check_ups
command_line $USER1$/check_ups_snmp.sh -H $HOSTADDRESS$
}
define service{
use generic-service
host_name ROZAS-SAI-AUDITORIO
service_description Ups Alarm
check_command check_ups!-C nagiosica -v 2c -p ups_alarm
normal_check_interval 30
retry_check_interval 10
notification_interval 0
register 1
}
We have Restarted the nagios service but in the web interface it appearan error and does not perform properly check (see attachment ) may be going on ? Instead through command line it works correctly :
root@snoc01debian01:/usr/local/nagios/libexec# ./check_ups_snmp.sh -H 192.168.2.31 -v 2c -C nagiosica -p ups_alarm
OK - 0 alarms present |'alarms'=0
Thank you so mutch!
Error "Unknown option" in Nagios check
Re: Error "Unknown option" in Nagios check
What are the permissions of check_ups_snmp.sh?
Former Nagios Employee
Re: Error "Unknown option" in Nagios check
These are the permitions of de file:rkennedy wrote:What are the permissions of check_ups_snmp.sh?
-rwxrwxrwx 1 root nagios 12474 may 14 2014 check_ups_snmp.sh
Re: Error "Unknown option" in Nagios check
Could you try to run the command as the user nagios?
Rob Hassing


-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Error "Unknown option" in Nagios check
Change your command to this
You are missing the $ARG1$
Code: Select all
define command {
command_name check_ups
command_line $USER1$/check_ups_snmp.sh -H $HOSTADDRESS$ $ARG1$
}Re: Error "Unknown option" in Nagios check
Wow, Scott has the allseeing eye. I missed that one 
Rob Hassing


Re: Error "Unknown option" in Nagios check
The check is already ok!!!! the problem was due to the absence of $ ARG1 $ argument , thank you very much to all for your help!!!!!!!!!!rhassing wrote:Wow, Scott has the allseeing eye. I missed that one
Re: Error "Unknown option" in Nagios check
Good to hear! I'll go ahead and close this out, feel free to create a new thread if you need any assistance in the future!
Former Nagios Employee