Executing POST statement
Re: Executing POST statement
I ran it, it's asking for a password. Which I don't remember. May I ask what will this give me?
Re: Executing POST statement
Did you replace "testdude" and "password" in
with your username and password (for the post)? If so, then something you trying to do requires root or elevated privileges to run as it worked when you ran it from the cli as the "root" user. Lets check the permissions on "check_http":abrist wrote:'username=testdude&password=password'
Code: Select all
ls -la /path/to/plugins/check_http
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Executing POST statement
Here is what I have
[nagios@stageutil01 libexec]$ ls -al | grep http
-rwxr-xr-x 1 nagios nagios 321432 May 12 2010 check_http
The username and password is used as part of the POST data that's passed into the applications API
[nagios@stageutil01 libexec]$ ls -al | grep http
-rwxr-xr-x 1 nagios nagios 321432 May 12 2010 check_http
The username and password is used as part of the POST data that's passed into the applications API
Re: Executing POST statement
Alright. So if you run the command as "root" it works, but if you run it as "nagios" is fails waiting for login credentials? I ask because most service check plugins in nagios run as the "nagios" user, not "root".
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Executing POST statement
I was able to switch to nagios
-bash-3.00$ ./check_http -H stageweb01 -w 2 -c 4 -u /fans/rs/login? -p 8088 -P 'username=testdude&password=password'
HTTP OK: HTTP/1.1 200 OK - 1590 bytes in 0.120 second response time |time=0.120300s;2.000000;4.000000;0.000000 size=1590B;;;0
-bash-3.00$ id
uid=10003(nagios) gid=888(nagios)
It works as well
-bash-3.00$ ./check_http -H stageweb01 -w 2 -c 4 -u /fans/rs/login? -p 8088 -P 'username=testdude&password=password'
HTTP OK: HTTP/1.1 200 OK - 1590 bytes in 0.120 second response time |time=0.120300s;2.000000;4.000000;0.000000 size=1590B;;;0
-bash-3.00$ id
uid=10003(nagios) gid=888(nagios)
It works as well
Re: Executing POST statement
Does you check work without the "?" at the end of the uri option? I ask because it was missing earlier in your config post.
Code: Select all
define service{
use generic-service
hostgroup_name stage_webservers
service_description Web_sso2_8088_login
check_command check_http!2!4!/fans/rs/login?!8088!'username=testdude&password=password'
notifications_enabled 1
}
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Executing POST statement
I updated my command definition, it fails both with ? and without ?
Re: Executing POST statement
Can you post the command definition for "check_http" from your commands.cfg file?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Executing POST statement
I ended up creating a separate command definition called check_http_POST and changed my service definition to reference this command and it worked.