When using the nagios report mode, webinject exits after the first failed check.
It usually makes no sense to test a login for example if the login form page could
not be loaded.
But why not use check_multi?
Sven
TEXT OUTPUT | OPTIONAL
PERFDATA
LONG TEXT LINE 1
LONG TEXT LINE 2
...
LONG TEXT LINE N | PERFDATA LINE
2
PERFDATA LINE 3
...
PERFDATA LINE N
where LONG TEXT LINE 1 would be the label from case with id=1,
LONG TEST LINE 2 ..., etc..., and the overall evaluated status of
that particular case, not considering if a step1 inside case1 is
ok and step2 inside case1 is CRITICAL, because this means that the
entire case with id=1 is failed. And that is how webinject
curently evaluates each case. Right?
TEXT OUTPUT | OPTIONAL PERFDATA
LONG TEXT LINE 1
LONG TEXT LINE 2
...
LONG TEXT LINE N
So all performance data is in the first line. This makes it compatible to nagios 2 and does not make a difference for nagios 3 because performance data is not for humans.
The long text is used for the complete text output. So when i got you right, you just want to strip the long plugin output down to display only the resulting case state instead of the full output?
Have a look at this examle, the perf data is on the first line with the result which nagios will display. The other output is the complete test result which will be displayed in nagios when you have a detailed look at the service. Is'nt that what you are looking for?
%> ./check_webinject t/data/04-repeated_tests.xml
WebInject CRITICAL - Test case number 1 failed|time=0.064;0;0;0;0 case1=0;0;0;0;0 case1=0;0;0;0;0 case1=0;0;0;0;0 case1=0;0;0;0;0 case1=0;0;0;0;0
Starting WebInject Engine (v1.56)...
-------------------------------------------------------
Test: t/data/04-repeated_tests.xml - 1
test response code 200
GET Request: /code/200
Verify Response Code: "200"
Failed HTTP Response Code Verification (received 400, expecting 200)
TEST CASE FAILED
Response Time = 0 sec
-------------------------------------------------------
Test: t/data/04-repeated_tests.xml - 1
test response code 200
GET Request: /code/200
Verify Response Code: "200"
Failed HTTP Response Code Verification (received 400, expecting 200)
TEST CASE FAILED
Response Time = 0 sec
-------------------------------------------------------
Test: t/data/04-repeated_tests.xml - 1
test response code 200
GET Request: /code/200
Verify Response Code: "200"
Failed HTTP Response Code Verification (received 400, expecting 200)
TEST CASE FAILED
Response Time = 0 sec
-------------------------------------------------------
Test: t/data/04-repeated_tests.xml - 1
test response code 200
GET Request: /code/200
Verify Response Code: "200"
Failed HTTP Response Code Verification (received 400, expecting 200)
TEST CASE FAILED
Response Time = 0 sec
-------------------------------------------------------
Test: t/data/04-repeated_tests.xml - 1
test response code 200
GET Request: /code/200
Verify Response Code: "200"
Failed HTTP Response Code Verification (received 400, expecting 200)
TEST CASE FAILED
Response Time = 0 sec
-------------------------------------------------------
Start Time: Wed Jan 12 17:56:20 2011
Total Run Time: 0.064 seconds
Test Cases Run: 5
Test Cases Passed: 0
Test Cases Failed: 5
Verifications Passed: 0
Verifications Failed: 5
WebInject CRITICAL - Test case number 2 failed | time=0.064;0;0;0;0<CASE 1 LABEL> OK
There can be more than one test for each case. And webinject does not know why case 3 fails it just can tell what failed. Don't expect too much intelligence, its just a dump script :-)
Ideas for better readability are welcome.
> And Sven this discussion tends to be more of a feature idea. I am very happy that there is a tool for nagios that knows how to make
> automatic web app tests and collect perfdata. If the output would be more friendly but also detailed and concise the tool will be great.
i know :-)
> Other enhancements wihch I consider usefull would be more than 4 verifypositive,verifynegative, etc...
Just pushed that change to git.
On 1/12/11 18:28, Theodor Chirana wrote:<CASE 1 LABEL> OK <CASE 2 LABEL> CRITICAL - Failed HTTP Response Code Verification (received 400, expecting 200) <CASE 3 LABEL> UNKNOWN /* UNKNOWN because test case 2 was failed>There can be more than one test for each case. And webinject does not know why case 3 fails it just can tell what failed. Don't expect too much intelligence, its just a dump script :-) Ideas for better readability are welcome.
| Status Information | TESTCASE OK - All tests
passed successfully in 0.22 seconds 1. Main page for whoswho OK 2. Search for a name OK 3. Results of the search OK 4. Employee page OK |
| Performance Data | time=0.22;0;30;0;0 Main page for whoswho=0.062;10;20;0;0 Search for a name=0.023;10;20;0;0 Results of the search=0.016;10;20;0;0 Employee page=0.006;10;20;0;0 |
And Sven this discussion tends to be more of a feature idea. I am very happy that there is a tool for nagios that knows how to make automatic web app tests and collect perfdata. If the output would be more friendly but also detailed and concise the tool will be great.i know :-)Other enhancements wihch I consider usefull would be more than 4 verifypositive,verifynegative, etc...Just pushed that change to git.
> I you can explain a little bit the code I might be able to help and
> develop a option that would show in LONG TEXT OUTPUT the label and
> exit state of each case. And even do some html formatting (see how
> nagios handles html or css output) and do soem coloring of the text
> like green when it is ok, red when it is warning .. standard nagios
> colors.
This should be optional. Nagios does not always print html, thats a config option
from the cgi.cfg. But using the lable is a good idea. Maybe a shotlog and a fullog
option. Something like that should be possible.
> And another crazy ideea maibe we can switch the entire code to
> python.... if you like it of course
Thats a really crazy idea. I don't think that will happen.
Its on my Todo list. I just had no time yet to think about it...
Sven