Sponsored Content
Full Discussion: Nagios script output issue
Special Forums UNIX and Linux Applications Infrastructure Monitoring Nagios script output issue Post 302448745 by jacki on Friday 27th of August 2010 12:23:13 PM
Old 08-27-2010
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. OK, WARN, ERROR based on the exit from the script. After 2-3 hrs output which was (and should be) OK or WARN starts returning CRITICAL and the output line says "Application is" and not even "Application is ERROR" or "Application is FATAL".

There is nothing in the logs to suggest what could be the problem. Have you experienced this before and let me know the corrective action. I am running Nagios on Mac OSX.

Here is the script for the curious -
Code:
#!/bin/bash

read URL < "$1"

STATUS=`curl -s $URL |grep summary|awk -F\" '{print $2}'`
echo "Application is $STATUS"
echo "curl $URL"

case $STATUS in
OK)
   exit 0
   ;;
WARN)
  exit 1
  ;;
ERROR)
  exit 2
  ;;
FATAL)
  exit 2
  ;;
*)
  exit 2
  ;;
esac

Thanks,
Jack

---------- Post updated at 11:23 AM ---------- Previous update was at 12:27 AM ----------

When I run the script on the commandline it returns the correct status.

But on nagios it shows different error.

Any clues?

Thanks,
Jack

Last edited by Franklin52; 08-27-2010 at 02:24 PM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Nagios Alerts Issue

Hi, I had installed Nagios on RHEL5.0 for Server Monitoring and configured the email alerts. Presently i am able to get the alerts of the c drive space,ftp,http services, But when the host goes down I dont get any alert saying that the Host is down or Host is Up. Request you to please help me... (4 Replies)
Discussion started by: Arun.Kakarla
4 Replies

2. Solaris

Duplex Script - output format issue.

Hi Gurus, I had downloaded the below script from the net and used it to get the Link and duplex settings in my Sun servers. In all except one(Sol-5.10 on X86) i am getting output format like below: root: /var/ADMIN/bin/speed_duplex.sh Interface Speed Duplex --------- ... (2 Replies)
Discussion started by: Hari_Ganesh
2 Replies

3. Infrastructure Monitoring

Nagios on Solaris 10 Sparc issue

I've got it installed but when I logging to the interface to http://localhost/nagios I get the following: Forbidden You don't have permission to access /nagios/ on this server. Apache/2.0.63 (Unix) DAV/2 Server at localhost Port 80 im running Solaris Version: SunOS dotstoas442 5.10... (0 Replies)
Discussion started by: frenchykd
0 Replies

4. Infrastructure Monitoring

Hooking script into Nagios

Hi! I have a perl script which returns data in the following format - AppName : BillingApp "status" = "OK"; AppName : PaymentApp "status" = "WARN"; AppName : OrderApp "status" = "ERROR"; AppName : OrderApp "status" = "FATAL"; the output consists of... (4 Replies)
Discussion started by: jacki
4 Replies

5. Infrastructure Monitoring

Facing Issue in Nagios 3.3

Hi, I have installed Nagios on Redhat Linux, I have installed Nagios+Plugins+NRPE on Server A (Host Server) and Nagios Plugins + nrpe on remote linux server (red hat linux) run the command on remote linux host, it returns nrpe version usr/local/nagios/libexec/check_nrpe -H localhost ... (1 Reply)
Discussion started by: manoj.solaris
1 Replies

6. Shell Programming and Scripting

df script output issue

hi all,i m using this script for disk space : #################################### #!/bin/ksh # HOSTS='/usr/bin/cat /host_list' DATE=$(date) DISK=$(df -gt) afile=/tmp/diskspace.log >$afile # for i in $HOSTS do echo ip: $i passed echo ip: $i passed >>$afile ... (1 Reply)
Discussion started by: viveksangwan
1 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. Shell Programming and Scripting

awk Script Output in Outlook Formatting Issue

When i execute the below shell script with 2 different Input files, for one of the data files (datafile1) my email message body in the outlook messes up and every thing comes up in one line. May i please know what i am doing wrong here or how to fix this? The only difference in data files is one is... (1 Reply)
Discussion started by: Ariean
1 Replies
nagios(8)							      Nagios								 nagios(8)

NAME
Nagios - network/systems status monitoring daemon SYNOPSIS
nagios [-h] [-v] [-s] [-d] <main_config_file> DESCRIPTION
nagios is a daemon program that monitors the status of various network accessible systems, devices, and more. For more information, please consult the online documentation available at http://www.nagios.org, or on your nagios server's web page. OPTIONS
main_config_file The main configuration file. On openSUSE systems this defaults to /etc/nagios/nagios.cfg -h A helpful usage message -v Reads all data in the configuration files and performs a basic verification/sanity check. Always make sure you verify your config data before (re)starting Nagios. You can also use the Nagios init script to verify your configuration - try: rcnagios check_verbose -s Shows projected/recommended check scheduling information based on the current data in the configuration files. -d Starts Nagios in daemon mode (instead of as a foreground process). FILES
/etc/nagios Default configuration directory for nagios AUTHOR
Nagios is written and maintained by Ethan Galstad <nagios@nagios.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) and adapted by Lars Vogdt for openSUSE. sean finney, Lars Vogdt February 2006, May 2010 nagios(8)
All times are GMT -4. The time now is 08:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy