Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add icinga2 package output for debian-based distributions #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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 <[email protected]>
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