Nagios User / check_3par / Works on Command Line, not in XI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sav2880
Posts: 60
Joined: Tue Mar 13, 2012 8:24 am

Nagios User / check_3par / Works on Command Line, not in XI

Post by sav2880 »

Hello,

I'm working on getting a configuration script in place for check_3par. I've gone through some similar issues to another user that posted this thread.

http://support.nagios.com/forum/viewtop ... 16&t=22214

I'm a bit more perplexed though. When I run the requisite command line:

Code: Select all

/usr/local/nagios/libexec/check_3par 3par7400-1.FQDN /usr/local/nagios/libexec/3par7400.pwf check_pd
... AFTER I've logged into the 3PAR CLI one time and accepted the self-signed certificate, it works fine. I've done all this as the nagios user. However, when I attempt to let XI run this command check, it fails saying it cannot connect to the InServ 3par7400.FQDN.

A review of the temp file that it creates shows it's locking up at the certificate acceptance screen.

Code: Select all

The authenticity of the storage system cannot be established.
CLI Server Certificate
  Issuer:           CN=HP_3PAR 7400-1611722
  Subject:          CN=HP_3PAR 7400-1611722
  SHA1 fingerprint: [FINGERPRINT CODE]
  Validity:         Not before: Feb  5 21:22:08 2015 GMT
                    Not after:  Feb  4 21:22:08 2018 GMT
  Warning: self signed certificate
  Warning: unsupported certificate purpose
  Warning: subject CN ("HP_3PAR 7400-1611722") does not match the system name ($
Continue connecting (yes/no)?
What I don't get is this ... if I can run the command via shell, why won't Nagios XI run this as the same user, why does it want to accept the certificate?

Now upon digging some, I see that the 3PAR Cli created a file in my home directory:

~/.hp3par/excp

Why would the command line instance accept this but the system-run command not? Do I need to copy this file to a separate directory on the machine so that the auto-acceptance will carry over? It would seem like both a non-shell run command and a shell run command would use the same home directory, but let me know if I need to make a copy of this file to cover that possibility.

P.S. - The OS is Oracle Linux 6.5. I know it's not officially supported, but for this purpose, treat it as if it's normal RHEL.

Thanks!
sav2880
Posts: 60
Joined: Tue Mar 13, 2012 8:24 am

Re: Nagios User / check_3par / Works on Command Line, not in

Post by sav2880 »

Fixed!

The answer? An edit to the script itself by adding a -certdir environment variable to the mix to force it to look at the right directory regardless if it's a shell or system command.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios User / check_3par / Works on Command Line, not in

Post by lmiltchev »

Can we lock the topic and mark it as resolved?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked