Skip to content
Snippets Groups Projects
Commit 55caca63 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch '6745-extend-unit-check' into 'master'

add about

See merge request !200
parents e3d23934 4866d634
No related branches found
No related tags found
1 merge request!200add about
about 0 → 100755
#!/bin/bash
# ======================================================================
#
# Icinga/ Nagios Check
# ABOUT
#
# ----------------------------------------------------------------------
# 2020-10-23 v1.0 <axel.hahn@iml.unibe.ch>
# ======================================================================
. $( dirname $0 )/inc_pluginfunctions
. /etc/icingaclient/client.cfg 2>/dev/null
# ----------------------------------------------------------------------
# FUNCTIONS
# ----------------------------------------------------------------------
function _section(){
echo ">>>>>>>>>> $*"
}
# ----------------------------------------------------------------------
# MAIN
# ----------------------------------------------------------------------
_iCpu=$( grep -c "processor" /proc/cpuinfo )
_sCpuModel=$(grep "model name" /proc/cpuinfo | sort -u )
_iMem=$( grep "MemTotal:" /proc/meminfo | awk '{ print $2 }' )
_sMem=$( grep "MemTotal:" /proc/meminfo | awk '{ print $2 " " $3}' )
_sSwap=$( grep "SwapTotal:" /proc/meminfo | awk '{ print $2 " " $3}' )
# ----- status line
echo -n $( ph.getOS; ph.getOSMajor )
echo -n " | ${_iCpu} cpu"
echo -n " | $(ph.toUnit "${_iMem}K" "G" 3) GB ram"
echo
echo
# ----- body text
_section "CPU: $_iCpu"
echo "${_sCpuModel}"
echo
echo
_section "Memory"
echo "RAM total ${_sMem}"
echo "Swap ${_sSwap}"
echo
echo
if [ -d "${dir_checks}" ]; then
_section "Services"
cd "${dir_checks}"
ls -1 Service-* | cut -f 2- -d "-" |
cd - >/dev/null 2>&1
echo
echo
fi
# _section "Disk"
# df -h
# echo
# echo
# _section "network"
# ip -o a
# echo
# cat /etc/resolv.conf | grep "^[a-z0-9]"
# ----------------------------------------------------------------------
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment