[ SEA-GHOST MINI SHELL]
#!/bin/bash
value=$1
runtimestats=/opt/open-xchange/sbin/showruntimestats
if [ -x $runtimestats ]; then
if [ $value == "DBConn" ]; then
$runtimestats -a | grep "com.openexchange.pooling:name=Overview,NumConnections"| sed 's/ //g'| awk -F "=" '{print $3}'
elif [ $value == "DBBrokenReadConn" ]; then
$runtimestats -a | grep "com.openexchange.pooling:name=ConfigDB Read,NumBrokenConnections"| sed 's/ //g'| awk -F "=" '{print $3}'
elif [ $value == "DBBrokenWriteConn" ]; then
$runtimestats -a | grep "com.openexchange.pooling:name=ConfigDB Write,NumBrokenConnections"| sed 's/ //g'| awk -F "=" '{print $3}'
elif [ $value == "FallbackConn" ]; then
$runtimestats -a | grep "com.openexchange.pooling:name=Overview,MasterInsteadOfSlave"| sed 's/ //g'| awk -F "=" '{print $3}'
elif [ $value == "IMAPConn" ]; then
$runtimestats -a | grep "com.openexchange.monitoring:name=GeneralMonitor,NumberOfIMAPConnections"| sed 's/ //g'| awk -F "=" '{print $3}'
fi
fi
SEA-GHOST - SHELL CODING BY SEA-GHOST