Hi,
I'm getting the error message above when running a command from the Nagios server. Could someone please help on giving the right expression it is looking for? Line 88 of the shell script is shown below:
if [ $PAR_WARN -ge $PAR_CRIT ]; then
Sorry, still new to shell scripting.
Thanks.
./check_ironport.sh: line 88: [: CPU: integer expression exp
-
tonyyarusso
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: ./check_ironport.sh: line 88: [: CPU: integer expression
What are your values for $PAR_WARN and $PAR_CRIT? My first guess is that you are passing numbers with a decimal point instead of integers. If that is the case, and you actually need to support floats, then you'll want to try something like
Code: Select all
if [ $(echo "$PAR_WARN >= $PAR_CRIT" | /usr/bin/bc) -eq 1 ]; then
Re: ./check_ironport.sh: line 88: [: CPU: integer expression
warn=90
crit=95
crit=95
-
tonyyarusso
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: ./check_ironport.sh: line 88: [: CPU: integer expression
Could you attach a copy of the script as well as showing the command as issued (with arguments) and the terminal output?
Re: ./check_ironport.sh: line 88: [: CPU: integer expression
command - ./check_ironport.sh -H $HOSTADDRESS$ <user> <password> CPU 90 95
output - ./check_ironport.sh: line 88: [: CPU: integer expression expected
Can't collect data from an Ironpor appliance Ironport. Verify hostname, userID and password!
output - ./check_ironport.sh: line 88: [: CPU: integer expression expected
Can't collect data from an Ironpor appliance Ironport. Verify hostname, userID and password!
You do not have the required permissions to view the files attached to this post.
-
tonyyarusso
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: ./check_ironport.sh: line 88: [: CPU: integer expression
Do not use -H, as this plugin is not written to properly use switched arguments, but rather only positional ones. Right now you are telling it that $HOSTNAME is literally "-H", $USER is "$HOSTADDRESS", $PASSWORD is "<user>", $ARGS is "<password>", $PAR_WARN is "CPU", and $PAR_CRIT is "90". So, instead, use:
./check_ironport.sh $HOSTADDRESS <user> <password> CPU 90 95
./check_ironport.sh $HOSTADDRESS <user> <password> CPU 90 95
Re: ./check_ironport.sh: line 88: [: CPU: integer expression
Hi Tony,
Here's what I got from removing -H:
Usage: check_ironport.sh <hostname> <user> <password> <parameter> <warning_nro> <critical_nro>
Notes:
hostname - Can be a hostname or IP address
parameter - Can be status, cpu, ram, msgxhour, conn_in, conn_out, queue, workqueue,
msgs_in_quarantine, disk_util, queuedisk_usage or resourseconservation
parameters for STATUS are ignored but must be provided. The results for STATUS can be OK or critical.
parameters for RESOURSECONSERVATION should be 1 and 2.
Thanks.
Here's what I got from removing -H:
Usage: check_ironport.sh <hostname> <user> <password> <parameter> <warning_nro> <critical_nro>
Notes:
hostname - Can be a hostname or IP address
parameter - Can be status, cpu, ram, msgxhour, conn_in, conn_out, queue, workqueue,
msgs_in_quarantine, disk_util, queuedisk_usage or resourseconservation
parameters for STATUS are ignored but must be provided. The results for STATUS can be OK or critical.
parameters for RESOURSECONSERVATION should be 1 and 2.
Thanks.
-
tonyyarusso
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: ./check_ironport.sh: line 88: [: CPU: integer expression
Don't capitalize cpu then.
Re: ./check_ironport.sh: line 88: [: CPU: integer expression
That worked. Thank you so much!
Re: ./check_ironport.sh: line 88: [: CPU: integer expression
Tony,
Now all I have to figure is why Nagios is not getting the results somehow of a stopped windows service.
Again, thank you for your help on this.
Now all I have to figure is why Nagios is not getting the results somehow of a stopped windows service.
Again, thank you for your help on this.