Sponsored Content
Full Discussion: Hooking script into Nagios
Special Forums UNIX and Linux Applications Infrastructure Monitoring Hooking script into Nagios Post 302447021 by verdepollo on Friday 20th of August 2010 02:03:16 PM
Old 08-20-2010
The following is far from perfect or complete, but it should give you an idea:

Declare a nagios command and send the name of the service as a parameter by using nagios built-in macros.

Code:
define command{
command_name check_app
command_line /path/to/your/script $SERVICEDESC$
}



Then use a generic script to evaluate the status of the service. (based in rdcwayx' code):
Code:
#!/bin/bash
if [ -n "$(awk 'BEGIN{RS=""}/'$1'/{a[$3 FS $6]++}END{for (i in a) print i , a[i]}' your_file)" ]; then
	echo "App is OK" && exit $0;
else
	echo 'App down!' && exit 2;
else
	echo "Unknown Status" && exit 3;
fi


You might need to adjust paths according to your nagios.cfg file.

Smilie

Last edited by verdepollo; 08-20-2010 at 03:08 PM..
 

10 More Discussions You Might Find Interesting

1. Solaris

Hooking up to Console's on sun's

it there any docs out there anyhwre that have the specs for cabing to a sun console. I have an e420 here, i cant seem to get a console connection, i have triewd the silver serial connectors that come with the new dsun servers, but no luck with those. (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

2. Infrastructure Monitoring

Nagios on Linux

Hi All, I am new in Linux. I want to install Nagios on Linux. Kindly provide me guidelines for the same. Its urgent.......... (1 Reply)
Discussion started by: sunray
1 Replies

3. Infrastructure Monitoring

Nagios script output issue

Hi Folks, Nagios is acting a little weird for me, I have this external script which I hooked into Nagios, it merely does a curl/wget on a URL and returns the status based on string in the content/output. Initially for 2-3 hrs the script returns the right status and Nagios reports correctly i.e.... (4 Replies)
Discussion started by: jacki
4 Replies

4. UNIX and Linux Applications

Problems Hooking Sudoers into PAM/LDAP

Greetings!! I am attempting to solve a rather thorny issue and I was hoping that someone might have some insight into what is going on here.. At this point I have an openLDAP server that is working quite splendidly! :) I have a working directory with users able to authenticate it and TLS... (2 Replies)
Discussion started by: bluethundr
2 Replies

5. Red Hat

Nagios Problem

Hello, I installed Nagios on the Centreon Platform <----"Centralized monitoring platform" anyways now every time i click on any of the tabs inside centreon interface, it gives me a Blank page, i have no idea what to do. i thought of resetting nagios to an earlier time when it was running... (2 Replies)
Discussion started by: waelkd
2 Replies

6. Infrastructure Monitoring

How secure using Nagios?

Hello Experts, I have my windows servers located at different data-centers across US and I am monitoring all of them using Nagios server configured on a CentOS. All communications are done via public IP address and I doubt it can invite some security threats too. Can anyone let me know if it is... (3 Replies)
Discussion started by: naw_deepak
3 Replies

7. Infrastructure Monitoring

Nagios check dependent on second nagios server

We have a dual Nagios server setup. One is setup for internal server monitoring on our LAN, while the second Nagios server is hosted externally and is used for external checks only such as URL and ping checks form the WAN side. I was wondering if there is any way to setup cross dependencies... (1 Reply)
Discussion started by: eugenes18t
1 Replies

8. Shell Programming and Scripting

Expect script works on CLI, but not under Nagios

I'm having a problem scripting Expect to work as a Nagios check. The script runs fine from the cli, but not when run as a Nagios check. I turn on the debug output, and it looks like it's not seeing the whole buffer's worth of info, like it's paged interactively somehow. I'm new to Expect, but this... (1 Reply)
Discussion started by: dhargens
1 Replies

9. Shell Programming and Scripting

Nagios script to get total and free memory

Hi Experts, need some help. I`m trying to write a shell script to get free, used and total memory on our linux servers. It's working great, but i need follow some standards to make it a real nagios plugin. It's pretty simple, you just type two parameters to the script, check_ram -w 80 -c 90... (4 Replies)
Discussion started by: berveglieri
4 Replies

10. UNIX for Dummies Questions & Answers

Memcache in Nagios

Hello, I want to setup Nagios with service Memcache...We have Amazon Cloud..Please help me to setup this service on my Nagios Client. How to check Memcache is working or not on my server?? 1. Please provide us the command defination to set on Nagios Server for .cfg file. 2.Please provide... (1 Reply)
Discussion started by: chetan
1 Replies
icingastats(8)							      icinga							    icingastats(8)

NAME
icingastats - report statistics information from the Icinga system SYNOPSIS
icingastats [-hVL] [-c config] [-m] [-d] DESCRIPTION
icingastats Is a program designed to provide information on the running Icinga system. It can provide a brief summary of information, or it can be used to export specific information about the nagios system into an MRTG-compatible format. For more information please consult the Icinga online documentation available at http://www.icinga.org or the documentation available with your icinga server's web page. OPTIONS
-c|--config=FILE The main configuration file. On debian systems this defaults to /etc/icinga/icinga.cfg -m|--mrtg Print output in MRTG-compatible format. For more details run icingastats with --help -d|--data=VARS Comma-seperated list of variables to output in MRTG format. For more details run icingastats with --help. -h|--help A helpful usage message -V|--version Print version information -L|--license Print license details FILES
/etc/icinga Default configuration directory for icinga AUTHOR
Icinga was started as Nagios by Ethan Galstad <nagios@nagios.org>. Icinga is maintained by the Icinga Project <info@icinga.org>. This manual page was written by sean finney <seanius@debian.org> for the Debian GNU/Linux operating system (but it may be freely used, modified, and redistributed by others). sean finney February 2006 icingastats(8)
All times are GMT -4. The time now is 06:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy