Page 1 of 2

HP 3PAR storage monitoring

Posted: Wed Dec 14, 2016 8:54 am
by uertti1
Hello,

I have a problem withc check_3par plugin when i want to use it it dispays information:
./check_3par.sh: line 50: $'\r': command not found
./check_3par.sh: line 354: syntax error: unexpected end of file
Can somebody explain me what should I do? For me code looks good but I'm useless in programing.

I will be greatfull for help :)

Re: HP 3PAR storage monitoring

Posted: Wed Dec 14, 2016 10:16 am
by uertti1
Ok.
I solved problem which won't let me restart ganios but now I have 7 more problems because of checks:
It is how it looks:
Image

Re: HP 3PAR storage monitoring

Posted: Wed Dec 14, 2016 12:38 pm
by mcapra
How was this plugin put on the Nagios XI server? That looks like there may be some encoding issues within the file.

You might try running the plugin through dos2unix:
http://linuxcommand.org/man_pages/dos2unix1.html

You could also try copying the plugin's contents and pasting them into a fresh file with vi/vim.

Re: HP 3PAR storage monitoring

Posted: Wed Dec 14, 2016 1:00 pm
by rkennedy
Also, in addition to what @mcapra posted - I believe it could be the variables being passed to Nagios, could you show us the complete command / service related definition?

Re: HP 3PAR storage monitoring

Posted: Thu Dec 15, 2016 3:06 am
by uertti1
I didn't put plugin on by web interface. I did it manually by creating plugin file via "vi" command and changing commands.cfg file.
# check_ps : Check Power Supply Node and Cage
# Degraded -> Warning
# Failed -> Critical
HERE IS LINE 50<---------------------------------------------------------------------------------
if ["$1" == "" ] || [ $2 == "" ] || [ $3 == "" ]
then
echo Invalid usage : check_3par InServ Username/passwordfile Command
exit 3
fi

INSERV=$1
USERNAME=$2
COMMAND=$3
TMPDIR=/usr/local/nagios/libexec
PCCRITICALFC=90
PCWARNINGFC=80
PCCRITICALNL=90
PCWARNINGNL=80
Here are my commands and services files.
http://textuploader.com/ddm9l
http://textuploader.com/ddm9q

Re: HP 3PAR storage monitoring

Posted: Thu Dec 15, 2016 2:31 pm
by rkennedy
Are you using SSH or the CLI to communicate with your 3par device? I would take a look at this document which should help to fill the missing links - https://exchange.nagios.org/components/ ... 0&cf_id=29

Re: HP 3PAR storage monitoring

Posted: Fri Dec 16, 2016 2:11 am
by uertti1
Ahh... Of course sorry. I should say about it earlier. Of course I'm trying to use SSH, and I can connect to storage by ssh from nagiosXI server.
I read this document while I was including 3par plugin configuration on nagios.

Re: HP 3PAR storage monitoring

Posted: Fri Dec 16, 2016 11:26 am
by rkennedy
Can you run the command correctly from the CLI?

Code: Select all

/usr/local/nagios/libexec/check_3par <iphere>
(replace <iphere>)

If that fails, please post the entire check_3par script for us to review.

Re: HP 3PAR storage monitoring

Posted: Mon Dec 19, 2016 4:23 am
by uertti1
This is what apears when I'm trying to use check command
[root@nagioss libexec]# /usr/local/nagios/libexec/check_3par <iphere>
/usr/local/nagios/libexec/check_3par: line 50: $'\r': command not found
/usr/local/nagios/libexec/check_3par: line 354: syntax error: unexpected end of file

Re: HP 3PAR storage monitoring

Posted: Mon Dec 19, 2016 11:21 am
by rkennedy
If that fails, please post the entire check_3par script for us to review.
We'll need to take a look at it.