Module: check_mk
Branch: master
Commit: 711f10c8088ee5f77e29d5e5a9b10937b59398b3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=711f10c8088ee5…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Fri Jun 5 10:20:38 2015 +0200
#2118 FIX aix_sap_processlist: agent plugin now is more general to deal with various AIX
versions
it is now actively searching for the right path to its libraries
---
.werks/2118 | 10 ++++++++
ChangeLog | 1 +
agents/plugins/mk_sap.aix | 56 +++++++++++++++++++++++++++++++--------------
3 files changed, 50 insertions(+), 17 deletions(-)
diff --git a/.werks/2118 b/.werks/2118
new file mode 100644
index 0000000..2847d2e
--- /dev/null
+++ b/.werks/2118
@@ -0,0 +1,10 @@
+Title: aix_sap_processlist: agent plugin now is more general to deal with various AIX
versions
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i2
+Date: 1433492293
+
+it is now actively searching for the right path to its libraries
diff --git a/ChangeLog b/ChangeLog
index 7839e46..c30713b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
* 2216 raritan_pdu_ocprot: New check to monitor overcurrent protectors of Raritan
PDUs...
* 2323 FIX: df: Fix new graphs for all filesystem checks in case of existing inode
information
* 2305 FIX: agent_vsphere, esx_vsphere_sensors: now able to handle sensor names with
semicolon...
+ * 2118 FIX: aix_sap_processlist: agent plugin now is more general to deal with
various AIX versions...
Multisite:
* 2260 Improved load time of Check_MK GUI...
diff --git a/agents/plugins/mk_sap.aix b/agents/plugins/mk_sap.aix
index fb49227..5296664 100755
--- a/agents/plugins/mk_sap.aix
+++ b/agents/plugins/mk_sap.aix
@@ -23,34 +23,56 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+# cat sapservices
+##!/bin/sh
+#LIBPATH=/usr/sap/C01/DVEBMGS25/exe:$LIBPATH; export LIBPATH;
/usr/sap/C01/DVEBMGS25/exe/sapstartsrv pf=/usr/sap/C01/SYS/profile/START_DVEBMGS25_sap10c1
-D -u c01adm
+#LIBPATH=/usr/sap/DC1/SMDA98/exe:$LIBPATH; export LIBPATH;
/usr/sap/DC1/SMDA98/exe/sapstartsrv pf=/usr/sap/DC1/SYS/profile/DC1_SMDA98_sap10c1 -D -u
dc1adm
+#LIBPATH=/usr/sap/C02/DVEBMGS37/exe:$LIBPATH; export LIBPATH;
/usr/sap/C02/DVEBMGS37/exe/sapstartsrv pf=/usr/sap/C02/SYS/profile/START_DVEBMGS37_sap10c1
-D -u c02adm
+#LIBPATH=/usr/sap/DAA/SMDA97/exe:$LIBPATH; export LIBPATH;
/usr/sap/DAA/SMDA97/exe/sapstartsrv pf=/usr/sap/DAA/SYS/profile/DAA_SMDA97_sap10c1 -D -u
daaadm
+#LIBPATH=/usr/sap/DDB/SMDA96/exe:$LIBPATH; export LIBPATH;
/usr/sap/DDB/SMDA96/exe/sapstartsrv pf=/usr/sap/DDB/SYS/profile/DDB_SMDA96_sap10c1d -D -u
ddbadm
+
+# <<<aix_sap_processlist:sep(44)>>>
+# [69]
+# 05.06.2015 05:44:36
+# GetProcessList
+# OK
+# name, description, dispstatus, textstatus, starttime, elapsedtime, pid
+# msg_server, MessageServer, GREEN, Running, 2015 06 01 02:28:51, 99:15:45, 17563810
+# enserver, EnqueueServer, GREEN, Running, 2015 06 01 02:28:51, 99:15:45, 15466710
+# gwrd, Gateway, GREEN, Running, 2015 06 01 02:28:51, 99:15:45, 25428046
+# [68]
+# 05.06.2015 05:44:36
+# GetProcessList
+# OK
+# name, description, dispstatus, textstatus, starttime, elapsedtime, pid
+# jstart, J2EE Server, GREEN, All processes running, 2015 06 01 02:29:06, 99:15:30,
18087996
+# igswd_mt, IGS Watchdog, GREEN, Running, 2015 06 01 02:29:06, 99:15:30, 9765042
+
+#
+# <<<aix_sap_processlist:sep(44)>>>
+# GetProcessList
+# FAIL: NIECONN_REFUSED (Connection refused), NiRawConnect failed in plugin_fopen()
+
sapservices="/usr/sap/sapservices"
if [ -r "$sapservices" ]; then
- echo "<<<aix_sap_processlist>>>"
+ echo "<<<aix_sap_processlist:sep(44)>>>"
# loop over ids
cat $sapservices | while read LINE
do
command=$(echo $LINE | grep "^LIBPATH=/usr/sap/" | grep -v
"^LIBPATH=/usr/sap/D" | awk -F" " '{print $5}')
if [ -n "$command" ]; then
- id2=$(echo $command | awk -F"/" '{print $4}')
- path=$(echo "/sapmnt/$id2/exe")
- id=$(LIBPATH=$LIBPATH:$path $path/sappfpar SAPSYSTEM $command)
- echo -n "[$id]"
- LIBPATH=$LIBPATH:$path $path/sapcontrol -nr $id -function GetProcessList
+ id2=$(echo $command | awk -F"/" '{print $4}')
+ path=$(echo "/sapmnt/$id2/exe")
+ sappfpar=$(find $path -name sappfpar | head -1)
+ sapcontrol=$(find $path -name sapcontrol | head -1)
+ libpath=$(find $path -name libicuuc\*.a | head -1 | sed -e 's,/[^
/]*$,,')
+ id=$(LIBPATH=$LIBPATH:$libpath $sappfpar SAPSYSTEM $command)
+ echo -n "[$id]"
+ LIBPATH=$LIBPATH:$libpath $sapcontrol -nr $id -function GetProcessList
fi
done
fi
-# 16.02.2015 16:39:40
-# GetProcessList
-# OK
-# name, description, dispstatus, textstatus, starttime, elapsedtime, pid
-# msg_server, MessageServer, GREEN, Running, 2015 02 16 16:30:39, 0:09:01, 26345666
-# enserver, EnqueueServer, GREEN, Running, 2015 02 16 16:30:39, 0:09:01, 27787298
-
-# 16.03.2015 16:23:24
-# GetProcessList
-# FAIL: NIECONN_REFUSED (Connection refused), NiRawConnect failed in plugin_fopen()
-