Error "Unknown option" in Nagios check

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
tmeto
Posts: 26
Joined: Tue Aug 20, 2013 4:59 am

Error "Unknown option" in Nagios check

Post by tmeto »

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!
Attachments
Error Nagios.jpg
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Error "Unknown option" in Nagios check

Post by rkennedy »

What are the permissions of check_ups_snmp.sh?
Former Nagios Employee
tmeto
Posts: 26
Joined: Tue Aug 20, 2013 4:59 am

Re: Error "Unknown option" in Nagios check

Post by tmeto »

rkennedy wrote:What are the permissions of check_ups_snmp.sh?
These are the permitions of de file:
-rwxrwxrwx 1 root nagios 12474 may 14 2014 check_ups_snmp.sh
User avatar
rhassing
Posts: 416
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Error "Unknown option" in Nagios check

Post by rhassing »

Could you try to run the command as the user nagios?
Rob Hassing
Image
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Error "Unknown option" in Nagios check

Post by scottwilkerson »

Change your command to this

Code: Select all

define command {
command_name check_ups
command_line $USER1$/check_ups_snmp.sh -H $HOSTADDRESS$ $ARG1$
}
You are missing the $ARG1$
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
rhassing
Posts: 416
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Error "Unknown option" in Nagios check

Post by rhassing »

Wow, Scott has the allseeing eye. I missed that one :)
Rob Hassing
Image
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Error "Unknown option" in Nagios check

Post by hsmith »

All seeing IT :)
Former Nagios Employee.
me.
tmeto
Posts: 26
Joined: Tue Aug 20, 2013 4:59 am

Re: Error "Unknown option" in Nagios check

Post by tmeto »

rhassing wrote:Wow, Scott has the allseeing eye. I missed that one :)
The check is already ok!!!! the problem was due to the absence of $ ARG1 $ argument , thank you very much to all for your help!!!!!!!!!!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Error "Unknown option" in Nagios check

Post by rkennedy »

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
Locked