Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

SAP OSS Check

Rating
0 votes
Favoured:
0
Current Version
1.0
Last Release Date
2012-11-29
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios XI
  • Nagios Fusion
Owner
License
Apache
Hits
51227
Files:
FileDescription
check_saposs.shcheck_saposs.sh
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
SAP OSS Check
This plugin will attempt to connect to SAPOSS server on SAP via saprouter
#!/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