Nagios and a custom webinject.pl
Parish, Brent
bparish at cognex.com
Mon Jun 7 19:11:04 CEST 2010
Hi Paul.
I really have no idea if this might be the problem, but it is an easy
test to do.
I would suggest trying to run the webinject from the command line like
you have been but add a minus sign in the "su":
e.g. sudo su - nagios
The minus sign will force it to become more like a true login (the way
cron or Nagios would likely run it) and not potentially carry over your
current PATH and other environment variables.
- Brent
On Mon, Jun 7, 2010 at 1:17 AM, PRP <f.hugh at comcast.net> wrote:
Well after some work I found a few issues with the webinject.pl script
that
I introduced. Anyone new to this world like me if you need to run tests
as
the nagios user use "sudo su nagios" That will give you a shell running
under the nagios user. That took me some time to figure that out.
Unfortunately, that did not solve my problem. I can run my script under
the
nagios user without issue, but if I allow the service to run it in the
same
nature, it fails. I am perplexed so if anyone has any ideas I would
greatly
appreciate it.
-----Original Message-----
From: f.hugh at comcast.net [mailto:f.hugh at comcast.net]
Sent: Friday, May 28, 2010 12:04 PM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Nagios and a custom webinject.pl
We just deployed a new site that requires client certificates so I
found
a discussion thread on how to make a few changes to the script so that
it
would use the client certificate that I specified. I left the original
script intact along with all the nagios configs and named this new
script
webinjectcert.pl. I wanted 2 separate scripts and configs so that I did
not
disrupt what I already had running successfully
The new script works perfectly as long as I run it manually as sudo.
The problem is when I configure it for nagios with the same script,
config
file, and test case, it returns results that claim it could not log onto
the
site. I have enabled debugging in the nagios.cfg, but I just can't see
what
the problem is. I looked at the permissions on the new script and
certificate to make sure that wasn't it and they look fine. I am not
really
sure how to run it as the nagios user since I can't remember what the
password is and don't want to make a mess and change it.
Any ideas?
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20100607/fde7e573/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list