The attached files are the ones I downloaded and am using. 

Harry M. Hart Systems integrator
(757) 203-7422
DSN 668-7422
[EMAIL PROTECTED]
[EMAIL PROTECTED]

-----Original Message-----
From: Christian Schneemann [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2008 9:33 AM
To: nagios-users@lists.sourceforge.net
Cc: Hart, Harry M. CTR USJFCOM SUPPORT.SUPPORT JTC-I
Subject: Re: [Nagios-users] Oracle remote monitoring

On Tuesday July 8 2008 03:29:13 pm Hart, Harry M. CTR USJFCOM SUPPORT.SUPPORT 
JTC-I wrote:
> Hi,
Hi
>
> I am trying to monitor oracle services on a remote cluster. When I run 
> ./check_asm on the remote host it returns ORACLE_CLUSTER_asm OK: 0 
> problem(s). This is good!
>
> However, when I run ./check_nrpe -H 192.168.0.23 -c check_asm it 
> returns
> CHECK_NRPE: Socket timeout after 10 seconds.
Do you have nrpe configured correctly on both hosts? Nrpe has a debug mode, 
activate it and have a look in the logs.
Is a firewall running?

Some more input would be nice.


>
> Any help on this?
>
> Harry
>
> Harry M. Hart Systems integrator
> SAIC
> USJFCOM JIOC DCGS-A
> (757) 203-7422
> DSN 668-7422
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
>
>
> ----------------------------------------------------------------------
> --- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project, 
> along with a healthy diet, reduces your potential for chronic lameness 
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> 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



--
Christian Schneemann

-------------------------------------
SUSE LINUX Products GmbH,
Maxfeldstr. 5, D - 90409 Nürnberg

Phone:  +49 (0)911 - 740 53 0
e-mail:[EMAIL PROTECTED]
-------------------------------------
SUSE LINUX Products GmbH, GF: Markus Rex HRB 16746 (AG Nürnberg)
#!/bin/sh
#
#-*- mode: Fundamental; tab-width: 4; -*-
# ex:ts=4
#  check_oracle_cluster  -- Nagios Plugins for Oracle Cluster
#  Copyright (c) 2008 UNIFESP - Ricardo Alves dos Reis <[EMAIL PROTECTED]>
#
#  Redistribution and use in source and binary forms, with or without
#  modification, are permitted provided that the following conditions
#  are met:
#  1. Redistributions of source code must retain the above copyright
#     notice, this list of conditions and the following disclaimer.
#  2. Redistributions in binary form must reproduce the above copyright
#     notice, this list of conditions and the following disclaimer in the
#     documentation and/or other materials provided with the distribution.
#
#  THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
#  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
#  ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
#  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
#  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
#  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
#  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
#  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
#  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
#  SUCH DAMAGE.

PROGNAME=$(basename $0)
PROGPATH=$(echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,')
CRSSTAT_PATH="/usr/bin/sudo /app/crs/oracle/product/10.2.0/crs/bin/crsstat"
EGREP_PATH=`which egrep`
CUT_PATH=`which cut`
TR_PATH=`which tr`

EXIT_ERROR="1"
EXIT_OK="0"
EXIT_USAGE="64"
LOCAL_VERSION="0.80"


. $PROGPATH/utils.sh
exitstatus=$STATE_WARNING #default

help()
{
cat<<EOF
`basename $0` Version $LOCAL_VERSION
        
usage: `basename $0` -n [options]

Global Options:
 -n -- node

Options:
 -a     --      ASM
 -l     --      LISTENER        
 -g     --      GSD
 -o     --      ONS
 -v     --      VIP

Ex.

`basename $0` -n dbunifesp1 -a

EOF
exit $EXIT_USAGE
}

command()
{
TYPE_OF_STATUS="$1";shift
SERVICE="$1";shift
NODE="$1"
if    [ $TYPE_OF_STATUS = "s" ];then
    SERVICE_STATUS=$( $CRSSTAT_PATH 2>&1 |awk '$0 ~ /'${SERVICE}'/ && $5 ~ 
/'${NODE}'/ { print $2 }' )
elif  [ $TYPE_OF_STATUS = "i" ];then       
    INSTANCE_STATUS=$( $CRSSTAT_PATH 2>&1 |awk '$0 ~ /'${SERVICE}'/ && $5 ~ 
/'${NODE}'/ { print $3 }' )
else  
    echo "UNKNOW TYPE"    
fi    
}

check()
{
SERVICE="$1";shift
SERVICE_STATUS="$1";shift        
INSTANCE_STATUS="$1"

if [ "$SERVICE_STATUS" = "ONLINE" -a "$INSTANCE_STATUS" = "ONLINE" ];then
        echo "ORACLE_CLUSTER_${SERVICE} OK: 0 problem(s)"
        exit $STATE_OK
elif [ "$SERVICE_STATUS" = "ONLINE" -a "$INSTANCE_STATUS" = "OFFLINE" ];then
        echo "ORACLE_CLUSTER_${SERVICE} CRITICAL: Instance FAILED"
        exit $STATE_CRITICAL
elif [ "$SERVICE_STATUS" = "OFFLINE" ];then
        echo "ORACLE_CLUSTER_${SERVICE} CRITICAL: Service FAILED"
        exit $STATE_CRITICAL
else
        echo "ORACLE_CLUSTER_${SERVICE} WARNING: UNKNOW problem(s)"
        exit $STATE_WARNING
fi
}

init()
{
NODE="$1";shift
OPTIONS="$1"

if   [ "$OPTIONS" = "-a" ];then
    SERVICE="asm"    
    command s $SERVICE $NODE
    command i $SERVICE $NODE
    check $SERVICE $SERVICE_STATUS $INSTANCE_STATUS
elif [ "$OPTIONS" = "-l" ];then
    SERVICE="lsnr"    
    command s $SERVICE $NODE
    command i $SERVICE $NODE
    check $SERVICE $SERVICE_STATUS $INSTANCE_STATUS
elif [ "$OPTIONS" = "-g" ];then
    SERVICE="gsd"    
    command s $SERVICE $NODE
    command i $SERVICE $NODE
    check $SERVICE $SERVICE_STATUS $INSTANCE_STATUS
elif [ "$OPTIONS" = "-o" ];then
    SERVICE="ons"    
    command s $SERVICE $NODE
    command i $SERVICE $NODE
    check $SERVICE $SERVICE_STATUS $INSTANCE_STATUS
elif [ "$OPTIONS" = "-v" ];then
    SERVICE="vip"    
    command s $SERVICE $NODE
    command i $SERVICE $NODE
    check $SERVICE $SERVICE_STATUS $INSTANCE_STATUS
fi
}

if [ $# -eq 0 ];then
        help
fi

while getopts "halgovn:" OPT ;do
    if [ "$OPT" = "n" ];then
            case "$3" in
                    "-a")
                                init $OPTARG $3
                                shift;;
                    "-l")
                                init $OPTARG $3
                                shift;;
                    "-g")
                                init $OPTARG $3
                                shift;;
                    "-o")
                                init $OPTARG $3
                                shift;;
                    "-v")
                                init $OPTARG $3
                                shift;;
                    *)
                        help
                        exit 2
            esac
    fi       
done
#!/usr/bin/ksh
#
# Sample 10g CRS resource status query script
#
# Description:
#    - Returns formatted version of crs_stat -t, in tabular
#      format, with the complete rsc names and filtering keywords
#   - The argument, $RSC_KEY, is optional and if passed to the script, will
#     limit the output to HA resources whose names match $RSC_KEY.
# Requirements:
#   - $ORA_CRS_HOME should be set in your environment 

RSC_KEY=$1
QSTAT=-u
AWK=/bin/awk    # if not available use /usr/bin/awk

# Table header:echo ""
$AWK \
  'BEGIN {printf "%-45s %-10s %-18s\n", "HA Resource",                          
       "Target", "State";
          printf "%-45s %-10s %-18s\n", 
"-----------------------------------------",   "------", 
"--------------------";}'

# Table body:
$ORA_CRS_HOME/bin/crs_stat $QSTAT | $AWK \
 'BEGIN { FS="="; state = 0; }
  $1~/NAME/ && $2~/'$RSC_KEY'/ {appname = $2; state=1};
  state == 0 {next;}
  $1~/TARGET/ && state == 1 {apptarget = $2; state=2;}
  $1~/STATE/ && state == 2 {appstate = $2; state=3;}
  state == 3 {printf "%-45s %-10s %-18s\n", appname, apptarget, appstate; 
state=0;}'

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
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

Reply via email to