Web Transaction not working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
skyslayer
Posts: 11
Joined: Fri Oct 04, 2013 7:55 am

Web Transaction not working

Post by skyslayer »

I am in demo of the XI product and if this does not work we will not be purchasing the product

The setup is Centos 6.2 X64
Built using Linode Nagios XI Script

Code: Select all

System:
Nagios XI Version : 2012R2.4
CentOS release 6.4 (Final)
Gnome is not installed

Apache Information
PHP Version: 5.3.3
Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0
Server Name: xxxxxxx.xxxxxxx.com
Server Address: x.x.x.x
Server Port: 443

Nagios XI Data
nagios (pid 2645) is running...
NPCD running (pid 2596).
ndo2db (pid 2666) is running...
CPU Load 15: 0.23
Total Hosts: 4
Total Services: 14 
I made a webinject script that works from the CLI but says fail hard in Nagios XI
at this point I can't even find the location of the log for this run

Here is the Webinject this does work from the CLI using: /usr/local/nagios/libexec/check_webinject.sh xxxx_xxxx_xxx__Web_Transaction_config.xml

I have inserted X's for security

Code: Select all

<testcases repeat="1">

<case
id="1"
description1="Form Page1"
method="get"
url="http://xxxxx.com/request-quote"
verifypositive="Multi-file total:"
errormessage="Page 1 Error"
/>

<case
id="2"
description1="Form Entry"
method="post"
url="https://xxx.xxxx.com/request-quote"
postbody="submitted[name]=Automated Test Nagios XI TEST&submitted[company]=XXXX&submitted[email][email protected]&submitted[phone]=5125551212&submitted[additional_information]=Automated Test Script For Nagios XI&form_id=webform_client_form_77&op=Submit+Request+to+XXX"
verifyresponsecode="302"
errormessage="Form Entry Error"
sleep="3"
/>
</testcases>
This is a Drupal site one of many checks that we will be doing
skyslayer
Posts: 11
Joined: Fri Oct 04, 2013 7:55 am

Re: Web Transaction not working

Post by skyslayer »

I just deleted the old checks and recreated a new one and same thing

Here is my service status
I inserted X's for security
XXXX.XXXX.com Notifications are disabled for this host Request A Quote Transaction Critical 28m 4s 5/5 2013-10-04 10:36:56 (null)
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Web Transaction not working

Post by sreinhardt »

Where is the xxxx_xxxx_xxx__Web_Transaction_config.xml file located? What permissions are presently set for it, and what user were you testing from the cli as? My initial thought would be that the xml file needs to be in the libexec directory or be referenced by the full path in the nagios definition. It also definitely needs to have at least read access for the nagios group and possibly user. But if you can post answers to the above questions, that would be a good start.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
skyslayer
Posts: 11
Joined: Fri Oct 04, 2013 7:55 am

Re: Web Transaction not working

Post by skyslayer »

I ran from the script from CLI as root
this is the command
Again I used X's for security

Code: Select all

/usr/local/nagios/libexec/check_webinject.sh XXXX_Request_A_Quote_Transaction_config.xml
I used the wizard to set it up so I do not know where it is located That would be good to know! Where does the wizard store the script?

Post 2: I found the default location of the xml scripts

Code: Select all

/usr/local/nagiosxi/etc/components/webinject/
ls -l on the file looks like nagios has rights to the file

Code: Select all

-rw-r--r-- 1 apache nagios 250 Oct 4 10:10 /usr/local/nagiosxi/etc/components/webinject/XXX__XXX_Request_A_Quote_Transaction_config.xml
Post 3: Is it apache or nagios that run the scripts?

Post 4: here is the file security in the sh file I am running

Code: Select all

-rwxr-xr-x 1 root root 307 Oct 2 12:27 /usr/local/nagios/libexec/check_webinject.sh
Post 5: Last 20 lines of the log /usr/local/nagios/var/nagios.log

Code: Select all

Nagios 3.5.0 starting... (PID=29324)
[1380899416] Local time is Fri Oct 04 15:10:16 UTC 2013
[1380899416] LOG VERSION: 2.0
[1380899416] ndomod: NDOMOD 1.5.2 (06-08-2012) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
[1380899416] ndomod: Successfully connected to data sink. 0 queued items to flush.
[1380899416] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
[1380899416] Warning: Service 'XXX Request A Quote Transaction' on host 'XXX.XXX.com' has a notification interval less than its check interval! Notifications are only re-sent after checks are made, so the effective notification interval will be that of the check interval.
[1380899416] Warning: Service recovery notification option for contact 'nagiosadmin' doesn't make any sense - specify critical and/or warning options as well
[1380899416] Finished daemonizing... (New PID=29329)
[1380899506] SERVICE ALERT: 'XXX.XXX.com;XXX Request A Quote Transaction;CRITICAL;SOFT;1;(null)
[1380899566] SERVICE ALERT:'XXX.XXX.com;XXX Request A Quote Transaction;CRITICAL;SOFT;2;(null)
[1380881557] Warning: A system time change of 0d 5h 0m 12s (backwards in time) has been detected. Compensating...
[1380881614] SERVICE ALERT: 'XXX.XXX.com;XXX Request A Quote Transaction;CRITICAL;SOFT;3;(null)
[1380881674] SERVICE ALERT: 'XXX.XXX.com;XXX Request A Quote Transaction;CRITICAL;SOFT;4;(null)
[1380881734] SERVICE ALERT: 'XXX.XXX.com;XXX Request A Quote Transaction;CRITICAL;HARD;5;(null)
[1380900690] Warning: A system time change of 0d 4h 59m 30s (forwards in time) has been detected. Compensating...
[1380902974] Auto-save of retention data completed successfully.
Last edited by sreinhardt on Fri Oct 04, 2013 1:31 pm, edited 2 times in total.
Reason: Please edit your previous post to add information/questions if you are the last poster.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Web Transaction not working

Post by sreinhardt »

/usr/local/nagios/libexec/check_webinject.sh Should definitiely be apache:apache or nagios:nagios, it doesn't really matter either way. However that very possibly could be a part of the issue despite everyone having execute and read access. Everything else looks pretty good so far.

Code: Select all

chown nagios.nagios /usr/local/nagios/libexec/check_webinject.sh
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
skyslayer
Posts: 11
Joined: Fri Oct 04, 2013 7:55 am

Re: Web Transaction not working

Post by skyslayer »

I did The chown nagios.nagios /usr/local/nagios/libexec/check_webinject.sh
ls -l -rwxr-xr-x 1 nagios nagios 307 Oct 2 12:27 /usr/local/nagios/libexec/check_webinject.sh
It still shows
XXXX.XXXX.com XXXX Request A Quote Transaction Critical 2h 48m 31s 5/5 2013-10-04 17:58:09 (null)

I also tried
chown apache:apache /usr/local/nagios/libexec/check_webinject.sh
ls -l -rwxr-xr-x 1 apache apache 307 Oct 2 12:27 /usr/local/nagios/libexec/check_webinject.sh

XXXX.XXXX.com XXX Request A Quote Transaction This service has Critical 2h 55m 36s 5/5 2013-10-04 18:05:30 (null)

Any ideas
skyslayer
Posts: 11
Joined: Fri Oct 04, 2013 7:55 am

Re: Web Transaction not working

Post by skyslayer »

Ok I got it

Change the owner on the script xml file
chown nagios:nagios /usr/local/nagiosxi/etc/components/webinject/XXXX__Request_A_Quote_Transaction_config.xml
-rwxr-xr-x 1 nagios nagios 250 Oct 4 12:54 /usr/local/nagiosxi/etc/components/webinject/XXXX_Request_A_Quote_Transaction_config.xml

Is there any way to have Nagios XI change the permissions automatically when the wizard creates it?
One other thing as noted above with the ls and nagios view the nagios time is different from the system time how would I make them match?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Web Transaction not working

Post by slansing »

What was the user before you changed it? It should be changed automatically by the wizard so that it works properly. Is it working fine now?
skyslayer
Posts: 11
Joined: Fri Oct 04, 2013 7:55 am

Re: Web Transaction not working

Post by skyslayer »

This is what is was
-rw-r--r-- 1 apache nagios 250 Oct 4 10:10 /usr/local/nagiosxi/etc/components/webinject/XXXX__Request_A_Quote_Transaction_config.xml

And yes it is working after I did a
chown nagios:nagios /usr/local/nagiosxi/etc/components/webinject/XXXX__Request_A_Quote_Transaction_config.xml

I have not tried to do a new one yet to see what the permissions will be

Edit
10/04/05:27

I did a new Web Transaction new name and all no file security problems it is good in fact it has 29 checks (cases) in it to our Drupal server so far so good :)
along with the problem child request for quote form discussed earlier in this thread All is good with Web Transactions so far
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Web Transaction not working

Post by slansing »

Oh great to hear! Let us know if you run into this again? It could be that the first .xml was already in existence and was just overwritten with your wizard info so it never changed permissions.
Locked