Module: check_mk
Branch: master
Commit: 192827e7368bb809cffa6e9f0958c9afc905b6dd
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=192827e7368bb8…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Mon May 8 17:02:06 2017 +0200
4642 check_mk_agent: Added support for new storcli
In future releases the MegaCli will be replaced by storcli. Up to now the
output of this new cli is fully compatible to the old one.
Change-Id: I67330aec6e430f3df0eb29e904493056590bd699
---
.werks/4642 | 11 +++++++++++
agents/check_mk_agent.linux | 4 ++++
agents/check_mk_agent.openwrt | 4 ++++
3 files changed, 19 insertions(+)
diff --git a/.werks/4642 b/.werks/4642
new file mode 100644
index 0000000..9f5d6fc
--- /dev/null
+++ b/.werks/4642
@@ -0,0 +1,11 @@
+Title: check_mk_agent: Added support for new storcli
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1494255427
+Class: feature
+
+In future releases the MegaCli will be replaced by storcli. Up to now the
+output of this new cli is fully compatible to the old one.
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 7d1e3ea..9617379 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -493,6 +493,10 @@ elif type MegaCli64 >/dev/null ; then
MegaCli_bin="MegaCli64"
elif type megacli >/dev/null ; then
MegaCli_bin="megacli"
+elif type storcli >/dev/null ; then
+ MegaCli_bin="storcli"
+elif type storcli64 >/dev/null ; then
+ MegaCli_bin="storcli64"
else
MegaCli_bin="unknown"
fi
diff --git a/agents/check_mk_agent.openwrt b/agents/check_mk_agent.openwrt
index 79edea5..ca6838d 100755
--- a/agents/check_mk_agent.openwrt
+++ b/agents/check_mk_agent.openwrt
@@ -453,6 +453,10 @@ elif type MegaCli64 >/dev/null ; then
MegaCli_bin="MegaCli64"
elif type megacli >/dev/null ; then
MegaCli_bin="megacli"
+elif type storcli >/dev/null ; then
+ MegaCli_bin="storcli"
+elif type storcli64 >/dev/null ; then
+ MegaCli_bin="storcli64"
else
MegaCli_bin="unknown"
fi
Module: check_mk
Branch: master
Commit: 442e598afd9be8394e5db91ecc912775ee20254d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=442e598afd9be8…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon May 8 12:16:40 2017 +0200
Fixed Postfix process detection plus portability improvement.
* The path to the Postfix master contains an "sbin/" on Ubuntu.
* The 'if [[ ... ]]' syntax is a bash-ism (from 2.02 onwards), which we
should avoid in the agent. (Note that we should avoid the =~ operator in
it even more, it appeared in bash 3.0 only and had several bugs.)
Change-Id: I4cb920bdb3dddcf741714a4f22d26bdcf3a65047
---
agents/check_mk_agent.linux | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 5b2a580..7d1e3ea 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -691,7 +691,7 @@ if type postfix >/dev/null ; then
do
if [ -e "$i/pid/master.pid" ]; then
postfix_pid=$(cat $i/pid/master.pid | sed 's/ //g') # handle possible spaces in output
- if [[ $(readlink -- /proc/$postfix_pid/exe) == *"postfix/master"* ]]; then
+ if readlink -- "/proc/$postfix_pid/exe" | grep -q ".*postfix/\(sbin/\)\?master.*"; then
echo "$i:the Postfix mail system is running:PID:$postfix_pid" | sed 's/\/var\/spool\///g'
else
echo "$i:PID file exists but instance is not running!" | sed 's/\/var\/spool\///g'