Operating System - HP-UX
1752478 Members
5791 Online
108788 Solutions
New Discussion юеВ

Re: Get Syntax Error when running a nagios Script

 
SOLVED
Go to solution
Mahesh Alexander
Frequent Advisor

Get Syntax Error when running a nagios Script

Hi all,

I am trying to run a script (attached) in a Server where I get a Syntax Error. I have used this script for all other servers without problems. HPUX version 11.23.

burbsdq1:/usr/local/nagios/libexec#./check_memory_hpux.sh -w 80 -c 90
./check_memory_hpux.sh[2]: FREEMB=: Syntax error
./check_memory_hpux.sh[2]: FREEMB=: Syntax error
./check_memory_hpux.sh[3]: * 20 / 100: Syntax error

I thought initially maybe due a different shell version but they`re the same.

Any idea why this is occurring?

Thx!
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor
Solution

Re: Get Syntax Error when running a nagios Script

Hi:

You would produce these errors (at least in part) if the server on which you are running did _not_ have pseudoswap enabled. That is, you would be missing the "memory" line in the output of 'swapinfo -tam'.

If you like, on the failing server, run:

# swapinfo -tam

...and post that output.

Regards!

...JRF...
Mahesh Alexander
Frequent Advisor

Re: Get Syntax Error when running a nagios Script

Hi James, you├В┬┤re right, check the output:

burbsdq1:/usr/local/nagios/libexec#swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8192 0 8186 0% 0 - 1 /dev/vg00/lvol2
dev 25600 0 25594 0% 0 - 1 /dev/vg00/lvswap2
reserve - 17666 -17666
total 33792 17666 16114 52% - 0 -

Mahesh Alexander
Frequent Advisor

Re: Get Syntax Error when running a nagios Script

Indeed the responsible variable for that is called

swapmem_on

and it was with value=0, so I had to changed it with the command

kmtune -s swapmem_on=1

Now we're waiting to reboot the server as it is needed to apply the changes.

Thanks James!!

Regards,