Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions icinga-diagnostics.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Icinga Diagnostics
# Collect basic data about your Icinga 2 installation
# maintainer: Thomas Widhalm <thomas.widhalm@icinga.com>
Expand Down Expand Up @@ -47,11 +47,15 @@ then
QUERYPACKAGE="rpm -q"
OS="REDHAT"
OSVERSION="$(cat /etc/redhat-release)"
# Debian-Versions
elif [ -f "/etc/debian_version" ]
then
QUERYPACKAGE="dpkg -l"
OS="$(grep ^NAME /etc/os-release | cut -d\" -f2)"
OS="$(grep ^NAME /etc/os-release | cut -d\" -f2 | cut -b-6)"
OSVERSION="${OS} $(cat /etc/debian_version)"
# Ubuntu-Versions
elif QUERYPACKAGE="dpkg -l"
then OS="$(egrep '^(NAME|VERSION\b)' /etc/os-release | cut -d\" -f2)"
elif [ "${UNAME_S}" = "FreeBSD" ]
then
QUERYPACKAGE="pkg info"
Expand Down Expand Up @@ -130,6 +134,15 @@ doc_icinga2() {
fi
done
;;
Debian|Ubuntu)
if [ ! ${FULL} ]
then
echo -n "Icinga 2 "
dpkg -s icinga2 | egrep '^(Package|Maintainer|Version)'
echo ""
dpkg -l | grep icinga | cut -b-65 | cut -b5-
fi
;;
FreeBSD) ${QUERYPACKAGE} -x icinga ;;
*) echo "Can not query packages on ${OS}" ;;
esac
Expand Down