Re: [Nagios-users] Connection refused question
Mark , first - please always post your questions to the list , you'll get faster answers and will share the knowledge earned with other members . As for your issue , see below : Background info: SSH Service: Reconfigure to non-standard port. 22 = 2270 HTTPD Service: Reconfigure to non-standard port. 80 = 8080 (I've got multiple web servers on the LAN serving different purposes. Apache on the Nagios server, (this server is my sandbox) listens on port 8080. In the localhost.cfg file: = define host{ use linux-server; Name of host template to use ; This host definition will inherit all variables that are defined ; in (or inherited by) the linux-server host template definition. host_name localhost alias localhost address 127.0.0.1 } define service{ use local-service ; Name of service template to use host_name localhost service_description HTTP check_command check_http notifications_enabled 1 } == in the services.cfg file === # 'check_http' command definition define command{ command_namecheck_http command_line$USER1$/check_http -I $HOSTADDRESS$ $ARG1$ } since you define a command to wait a argument , you need to supply that in the command call in the check execution - meaning in the declaration of the service . so your service definition should be something like this : define service{ use local-service ; Name of service template to use host_name localhost service_description HTTP check_command check_http!$ARG1$ notifications_enabled 1 } where $ARG!$ is the -p 8080 string you with to direct the HTTP request to . Assaf -- Assaf Flatto SSP Ops Team Linux System Administrator 169 Euston Road, London, NW1 2AE IMPORTANT . this email and the information in it may be confidential, legally privileged and/or protected by law. It is intended solely for the use of the person to whom it is addressed. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Please also delete all copies of this email and any attachments from your system. We cannot guarantee the security or confidentiality of email communications. We do not accept any liability for losses or damages that you may suffer as a result of your receipt of this email including but not limited to computer service or system failure, access delays or interruption, data non-delivery or mis-delivery, computer viruses or other harmful components. Copyright in this email and any attachments belong to Select Service Partner UK Limited. Should you communicate with anyone at Select Service Partner UK Limited by email, you consent to us monitoring and reading any such correspondence. Nothing in this email shall be taken or read as suggesting, proposing or relating to any agreement concerted practice or other practice that could infringe UK or EC competition legislation. Select Service Partner UK Limited is a company registered in England and Wales (company number 05687183) whose registered office is at 1 The Heights, Brooklands, Weybridge. Surrey. KT13 0NY -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Connection refused question
Mark First - welcome the a world of wonder (meaning nagios) . Second - the nagios install comes with a complete set of documentation you can access via the wen interface . And for your question - the file containing the definitions you are looking for is called either commands.cfg or misccommnd.cfg , it resides in the etc directory of the nagios installation . most likely you'll find a command called check_http with no parameters , that is because it is going to the default ports , RTFM and made the modifications . Good luck . Assaf On Saturday 28 February 2009 00:32:05 Mark Weaver wrote: Brian A. Seklecki wrote: My question is where in the nagios configuration do I change the setting so nagios knows what ports these two services are listening on? $ egrep -ir check_(ssh|http) in your {/usr/local,}/etc/nagios config dir: $ /usr/local/libexec/nagios/check_http -h|grep -i port strings and regular expressions, check connection times, and report on Usage: check_http -H vhost | -I IP-address [-u uri] [-p port] Append a port to include it in the header (eg: example.com:5000) -p, --port=INTEGER Port number (default: 80) Connect via SSL. Port defaults to 443 Minimum number of days a certificate has to be valid. Port defaults to 443 $ /usr/local/libexec/nagios/check_ssh -h|grep -i port Try to connect to an SSH server at specified server and port Usage:check_ssh [-46] [-t timeout] [-r remote version] [-p port] host -p, --port=INTEGER Port number (default: 22) Adjust the templates as nessecary, or customize. Great books out there, too, eat em up! ~BAS Hi Brian, While I appreciate your reply I have absolutely no idea what you said. As I mentioned earlier I'm a complete noobie when it comes to Nagios. I.e. this is my first time ever exposure to this system. i've been all over the config file and I can't find anywhere where it would appear you could set the ports services run on for a given host. Do they even exist? Mark --- --- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when ::: reporting any issue. Messages without supporting info will risk being ::: sent to /dev/null -- Assaf Flatto SSP Ops Team Linux System Administrator 169 Euston Road, London, NW1 2AE IMPORTANT . this email and the information in it may be confidential, legally privileged and/or protected by law. It is intended solely for the use of the person to whom it is addressed. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Please also delete all copies of this email and any attachments from your system. We cannot guarantee the security or confidentiality of email communications. We do not accept any liability for losses or damages that you may suffer as a result of your receipt of this email including but not limited to computer service or system failure, access delays or interruption, data non-delivery or mis-delivery, computer viruses or other harmful components. Copyright in this email and any attachments belong to Select Service Partner UK Limited. Should you communicate with anyone at Select Service Partner UK Limited by email, you consent to us monitoring and reading any such correspondence. Nothing in this email shall be taken or read as suggesting, proposing or relating to any agreement concerted practice or other practice that could infringe UK or EC competition legislation. Select Service Partner UK Limited is a company registered in England and Wales (company number 05687183) whose registered office is at 1 The Heights, Brooklands, Weybridge. Surrey. KT13 0NY -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version,
Re: [Nagios-users] Connection refused question
Note that most plugins can be executed from the shell prompt with a --help option. For example: $ /usr/local/nagios/libexec/check_http --help will tell you what all the possible options are for this plugin, including how to check a particular port number. It's usually best to make sure you're happy that the plugin is working by executing it yourself from the shell prompt before configuring it in the nagios config files. hth, Jim -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
[Nagios-users] Connection refused question
Hi all, I'm a total noob with Nagios. I've just completed the installation of Nagios on a server that is going to be the Nagios server. Once I got it compiled and running I started making some other modifications to other services on the system such as apache and ssh. What I did was change the ports on which these two services are listening on. Now I'm getting notifications that are telling me that connection attempts to these services are being refused. I strongly suspect it's because apache and ssh aren't listening on the default ports of 80 and 22. My question is where in the nagios configuration do I change the setting so nagios knows what ports these two services are listening on? thanks, Mark -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Connection refused question
My question is where in the nagios configuration do I change the setting so nagios knows what ports these two services are listening on? $ egrep -ir check_(ssh|http) in your {/usr/local,}/etc/nagios config dir: $ /usr/local/libexec/nagios/check_http -h|grep -i port strings and regular expressions, check connection times, and report on Usage: check_http -H vhost | -I IP-address [-u uri] [-p port] Append a port to include it in the header (eg: example.com:5000) -p, --port=INTEGER Port number (default: 80) Connect via SSL. Port defaults to 443 Minimum number of days a certificate has to be valid. Port defaults to 443 $ /usr/local/libexec/nagios/check_ssh -h|grep -i port Try to connect to an SSH server at specified server and port Usage:check_ssh [-46] [-t timeout] [-r remote version] [-p port] host -p, --port=INTEGER Port number (default: 22) Adjust the templates as nessecary, or customize. Great books out there, too, eat em up! ~BAS -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Connection refused question
Brian A. Seklecki wrote: My question is where in the nagios configuration do I change the setting so nagios knows what ports these two services are listening on? $ egrep -ir check_(ssh|http) in your {/usr/local,}/etc/nagios config dir: $ /usr/local/libexec/nagios/check_http -h|grep -i port strings and regular expressions, check connection times, and report on Usage: check_http -H vhost | -I IP-address [-u uri] [-p port] Append a port to include it in the header (eg: example.com:5000) -p, --port=INTEGER Port number (default: 80) Connect via SSL. Port defaults to 443 Minimum number of days a certificate has to be valid. Port defaults to 443 $ /usr/local/libexec/nagios/check_ssh -h|grep -i port Try to connect to an SSH server at specified server and port Usage:check_ssh [-46] [-t timeout] [-r remote version] [-p port] host -p, --port=INTEGER Port number (default: 22) Adjust the templates as nessecary, or customize. Great books out there, too, eat em up! ~BAS Hi Brian, While I appreciate your reply I have absolutely no idea what you said. As I mentioned earlier I'm a complete noobie when it comes to Nagios. I.e. this is my first time ever exposure to this system. i've been all over the config file and I can't find anywhere where it would appear you could set the ports services run on for a given host. Do they even exist? Mark -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null