Adding plugin to Nagios

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Apurv
Posts: 27
Joined: Wed Dec 17, 2014 8:34 pm

Adding plugin to Nagios

Post by Apurv »

Hello People,

I am here again with a new query....

I need to add a few domains to nagios and check there response(uptime/downtime). I could find a plugin named "check_website_response.sh"

Also found the command definition to be inserted in commands.cfg....

Any idea how to get this displayed on web-interface..... Could you please provide me the info on how to get this implemented ??

Also Box293, if possible could u lemme know what all new things u have tried and implemented?? So that I can try them on my end too
Last edited by lmiltchev on Thu Jul 30, 2015 9:00 am, edited 3 times in total.
Reason: Split from https://support.nagios.com/forum/viewtopic.php?f=7&t=31286&start=30
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Adding plugin to Nagios

Post by jdalrymple »

I think the check_http from the nagios plugins package does what you want:

Code: Select all

[jdalrymple@localhost ~]$ /usr/local/nagios/libexec/check_http www.google.com
HTTP OK: HTTP/1.0 200 OK - 19316 bytes in 0.148 second response time |time=0.148163s;;;0.000000 size=19316B;;;0
You could have a command for this that looks something like:

Code: Select all

define command {
       command_name                             check_http
       command_line                             $USER1$/check_http $ARG1$
}
Apurv
Posts: 27
Joined: Wed Dec 17, 2014 8:34 pm

Re: Adding plugin to Nagios

Post by Apurv »

Hello jdalrymple,

Thanks for your reply.

The website is hosted on a windows server. Hence I need to check the domain using some check on windows machine. Is there any command in nsclient++ that can check website??
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Adding plugin to Nagios

Post by tmcdonald »

It doesn't matter what OS is hosting the website, check_http just cares about the HTTP connection itself, the web page contents, etc. It will work just fine against your Windows-based website. It runs on the Nagios machine and you don't need to use NSClient++ unless there is something blocking requests from the Nagios server.
Former Nagios employee
Apurv
Posts: 27
Joined: Wed Dec 17, 2014 8:34 pm

Re: Adding plugin to Nagios

Post by Apurv »

Hi tmcdonald,

Thanks for your reply!

When I try to check using "check_http" I am getting time out errors. Could you please let me know.. what I could be missing out?

Should I open any ports on that windows server? OR Anything else that I need to do??
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Adding plugin to Nagios

Post by tgriep »

Could you post how you are running the check?
Can you run the check from the command line and post back the output?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Apurv
Posts: 27
Joined: Wed Dec 17, 2014 8:34 pm

Re: Adding plugin to Nagios

Post by Apurv »

Hello Guys,

Thanks for the help!

check_http plugin solved the issue as u guys had suggested me earlier. The silly mistake I was making is not adding "-H" while checking the same.

Once I added -H in the check command... I started getting the desired output.

Thanks alot.
Locked