get values from HTTP Post via nagios

Posted on 2011-10-13
Last Modified: 2012-05-12
I currently have a web service that posts 3 values to a page. I'd like to consume those values into Opsview (Nagios) and set thresholds of they go too high.

I was looking at Opsviews FAQ page and found this.

It is possible to generate graphs for specific performance data by appending an argument to the URL.

For graph based on check_http plugin, we get four pieces of data:

Response time (time)
Page size (size)
Warning threshold (time_warn)
Writical threshold (time_crit)
Standard URL will be similar to:

Appending '&db=,time' will generate graph based on 'time' value, eg:

Parameters can be combined so to display response time and critical threshold on same graph simply append '&db=,time,time_crit'

Here is the URL that i have. I'd like to get data for the values: dialing, connected and uncalled


Nagios doesn't know what to do if i run the check
check_http -H $HOSTADDRESS$ -u /outbound/webservice/outboundInfo.php?login=admin&pin=********&statuses=dialing,connected,uncalled -c 5

Open in new window

Question by:c3very
    LVL 39

    Expert Comment

    an & is also a shell command.
    It means start the previous command in a sub shell & don't wait for it.

    so you get check_http ....

    Try: (with the extra ' chars..)
    check_http -H $HOSTADDRESS$ -u '/outbound/webservice/outboundInfo.php?login=admin&pin=********&statuses=dialing,connected,uncalled' -c 5
    LVL 2

    Author Comment

    The extra characters definitely helped.

    I'm running the command in Putty as the nagios user and it actually comes back with a response now.

    nagios@opsview-appliance:/usr/local/nagios/libexec$ ./check_http -H $HOSTADDRESS$ -u '/outbound/webservice/outboundInfo.php?login=admin&pin=********&statuses=dialing,connected,uncalled&test' -c 5
    HTTP OK: HTTP/1.1 200 OK - 396 bytes in 0.008 second response time |time=0.008276s;;5.000000;0.000000 size=396B;;;0

    Open in new window

    Here is the post page and what it looks like:
    <outboundinfo status="info" total="127">
    <dialing total="37"/>
    <connected total="90"/>
    <uncalled total="0"/>

    Open in new window

    Hopefully the check can be modified to read these values.  If the post page needs to be modified to overcome any limitation of nagios it could probably be done.
    LVL 39

    Expert Comment

    check_http  is very limited. If you need a post use -P,
    You can verify using a regex (-r) if the result is what you expected...


    LVL 39

    Accepted Solution

    If you want more control then you may need to checkout curl ( as the tool of choice.
    and script around it.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
    Outsource Your Fax Infrastructure to the Cloud (And come out looking like an IT Hero!) Relative to the many demands on today’s IT teams, spending capital, time and resources to maintain physical fax servers and infrastructure is not a high priority.
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now