Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
SAP OSS Check
1.0
2012-11-29
- Nagios 1.x
- Nagios 2.x
- Nagios 3.x
- Nagios XI
- Nagios Fusion
Apache
51611
File | Description |
---|---|
check_saposs.sh | check_saposs.sh |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
#!/bin/bash
#set -x
################################################################################
#
# check_oss plugin for Nagios
#
# Originally Written by Kristijan Modric (kmodric_at_gmail.com)
#
# Created: 29 Nov 2012
#
# Version 1.0 (Kristijan Modric)
#
# Command line: check_saposs.sh
#
# Description:
# This plugin will attempt to connect to SAPOSS server on SAP via saprouter
# Please check SAP Note 182308 - Incorrect logon data in R/3 destination SAPOSS
#
# Notes:
# - This plugin requires that the sapinfo program is installed
# You can test SAPOSS conection running sapinfo with following options
# $ sapinfo mshost=/H//S/3299/H/194.117.106.129/S/3299/H/oss001 r3name=OSS group=EWA client=001 user=OSS_RFC passwd=CPIC
#
# Parameters:
# $1 - saprouter
#
# Example of command definitions for nagios:
#
# define command {
# command_name check_saposs
# command_line /usr/lib/nagios/plugins/check_saposs.sh $ARG1$
# }
#
##############################################################################
#Please set SAPINFO_HOME to the directory where you installed sapinfo
SAPINFO_HOME="/opt/rfcsdk/bin"
##############################################################################
STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
STATE_DEPENDENT=4
if [ ! -f $SAPINFO_HOME/sapinfo ];
then
echo -e "File sapinfo does NOT exists.nPlease check if the variable SAPINFO_HOME is pointing to the directory where you installed sapinfo."
fi
if [ $# -ne 1 ]; then
echo "Usage: $0"
echo "Example: $0"
exit 3
fi
#If failes firs time wait for 15 sec and then try again
result=`$SAPINFO_HOME/sapinfo mshost=/H/$1/S/3299/H/194.117.106.129/S/3299/H/oss001 r3name=OSS group=EWA client=001 user=OSS_RFC passwd=CPIC | strings`
if [[ $result == *"SAP kernel release"* ]]
then
echo "SAPOSS is working OK! | OSS=1"
exit $STATE_OK
else
sleep 15
result=`$SAPINFO_HOME/sapinfo mshost=/H/$1/S/3299/H/194.117.106.129/S/3299/H/oss001 r3name=OSS group=EWA client=001 user=OSS_RFC passwd=CPIC | strings`
if [[ $result == *"SAP kernel release"* ]]
then
echo "SAPOSS is working OK! | OSS=1"
exit $STATE_OK
else
echo "SAPOSS is NOT working! | OSS=0"
exit $STATE_CRITICAL
fi
fi
#set -x
################################################################################
#
# check_oss plugin for Nagios
#
# Originally Written by Kristijan Modric (kmodric_at_gmail.com)
#
# Created: 29 Nov 2012
#
# Version 1.0 (Kristijan Modric)
#
# Command line: check_saposs.sh
#
# Description:
# This plugin will attempt to connect to SAPOSS server on SAP via saprouter
# Please check SAP Note 182308 - Incorrect logon data in R/3 destination SAPOSS
#
# Notes:
# - This plugin requires that the sapinfo program is installed
# You can test SAPOSS conection running sapinfo with following options
# $ sapinfo mshost=/H/
#
# Parameters:
# $1 - saprouter
#
# Example of command definitions for nagios:
#
# define command {
# command_name check_saposs
# command_line /usr/lib/nagios/plugins/check_saposs.sh $ARG1$
# }
#
##############################################################################
#Please set SAPINFO_HOME to the directory where you installed sapinfo
SAPINFO_HOME="/opt/rfcsdk/bin"
##############################################################################
STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
STATE_DEPENDENT=4
if [ ! -f $SAPINFO_HOME/sapinfo ];
then
echo -e "File sapinfo does NOT exists.nPlease check if the variable SAPINFO_HOME is pointing to the directory where you installed sapinfo."
fi
if [ $# -ne 1 ]; then
echo "Usage: $0
echo "Example: $0
exit 3
fi
#If failes firs time wait for 15 sec and then try again
result=`$SAPINFO_HOME/sapinfo mshost=/H/$1/S/3299/H/194.117.106.129/S/3299/H/oss001 r3name=OSS group=EWA client=001 user=OSS_RFC passwd=CPIC | strings`
if [[ $result == *"SAP kernel release"* ]]
then
echo "SAPOSS is working OK! | OSS=1"
exit $STATE_OK
else
sleep 15
result=`$SAPINFO_HOME/sapinfo mshost=/H/$1/S/3299/H/194.117.106.129/S/3299/H/oss001 r3name=OSS group=EWA client=001 user=OSS_RFC passwd=CPIC | strings`
if [[ $result == *"SAP kernel release"* ]]
then
echo "SAPOSS is working OK! | OSS=1"
exit $STATE_OK
else
echo "SAPOSS is NOT working! | OSS=0"
exit $STATE_CRITICAL
fi
fi
Reviews (0)
Be the first to review this listing!