Use "command -v" instead of "which"
see http://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html#tag_20_22_18 Add "monitor" for ceph osd.
This commit is contained in:
parent
fede5d8b50
commit
f7337fd9d8
|
@ -36,7 +36,7 @@ for PART in /boot /home /opt /tmp /usr /var /var/lib/vz; do
|
|||
done
|
||||
|
||||
### IF ZFS
|
||||
if [ $(which zpool) ]; then
|
||||
if [ $(command -v zpool) ]; then
|
||||
printf '%b' "\n${MAGENTA}+++++++++++++++++++ ${WHITEB}ZFS${RESET} ${WHITE}Partitions${RESET} ${MAGENTA}:++++++++++++++++++${RESET}"
|
||||
NUMBER_PART=$(df -T | grep zfs | wc -l)
|
||||
LINE=1
|
||||
|
|
|
@ -62,7 +62,7 @@ service_info() {
|
|||
printf '%b' "${MAGENTA}+++++++++++++++++++: ${WHITE}Service Info${MAGENTA} :++++++++++++++++++++${RESET}"
|
||||
|
||||
## IF POSTFIX
|
||||
if [ $(which postfix) ]; then
|
||||
if [ $(command -v postfix) ]; then
|
||||
MSG=$(process_info "postfix" '')
|
||||
MSG=$(service_info "25" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
|
@ -70,7 +70,7 @@ fi
|
|||
## FI POSTFIX
|
||||
|
||||
### IF APACHE2
|
||||
if [ $(which apache2) ]; then
|
||||
if [ $(command -v apache2) ]; then
|
||||
MSG=$(process_info "apache2" '')
|
||||
MSG=$(service_info "80 443" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
|
@ -78,7 +78,7 @@ fi
|
|||
### FI APACHE2
|
||||
|
||||
### IF NGINX
|
||||
if [ $(which nginx) ]; then
|
||||
if [ $(command -v nginx) ]; then
|
||||
MSG=$(process_info "nginx" '')
|
||||
MSG=$(service_info "80 443" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
|
@ -86,7 +86,7 @@ fi
|
|||
### FI NGINX
|
||||
|
||||
### IF MYSQLD
|
||||
if [ $(which mysqld) ]; then
|
||||
if [ $(command -v mysqld) ]; then
|
||||
MSG=$(process_info "mysqld" '')
|
||||
MSG=$(service_info "3306" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
|
@ -94,7 +94,7 @@ fi
|
|||
### FI MYSQLD
|
||||
|
||||
### IF SLAPD
|
||||
if [ $(which slapd) ]; then
|
||||
if [ $(command -v slapd) ]; then
|
||||
MSG=$(process_info "slapd" '')
|
||||
MSG=$(service_info "389 636" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
|
@ -102,33 +102,37 @@ fi
|
|||
### FI SLAPD
|
||||
|
||||
### IF ZFS
|
||||
if [ $(which zfs) ]; then
|
||||
if [ $(command -v zfs) ]; then
|
||||
MSG=$(process_info "zfs" '')
|
||||
printf '%b' "\n${MSG}"
|
||||
fi
|
||||
### FI ZFS
|
||||
|
||||
### IF Ceph Monitor
|
||||
#if [ $(which ceph-mon) ]; then
|
||||
#if [ $(command -v ceph-mon) ]; then
|
||||
#ceph-mon is installed with the 'ceph' package
|
||||
#so we can't just check if `ceph-mon` is available on a system
|
||||
if (grep "mon_initial_members.*$(hostname)" /etc/ceph/*.conf > /dev/null); then
|
||||
MSG=$(process_info "ceph-mon" '')
|
||||
MSG=$(service_info "6789" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
if [ $(command -v ceph) ]; then
|
||||
if (grep "mon_initial_members.*$(hostname)" /etc/ceph/*.conf > /dev/null); then
|
||||
MSG=$(process_info "ceph-mon" '')
|
||||
MSG=$(service_info "6789" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
fi
|
||||
fi
|
||||
### FI Ceph Monitor
|
||||
|
||||
### IF Ceph OSD
|
||||
if (ceph osd tree | grep "host $(hostname)" > /dev/null 2> /dev/null); then
|
||||
MSG=$(process_info "ceph-osd" '')
|
||||
MSG=$(service_info "6800 6801 6802" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
if [ $(command -v ceph) ]; then
|
||||
if (ceph osd tree | grep "host $(hostname)" > /dev/null 2> /dev/null); then
|
||||
MSG=$(process_info "ceph-osd" '')
|
||||
MSG=$(service_info "6800 6801 6802" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
fi
|
||||
fi
|
||||
### FI Ceph OSD
|
||||
|
||||
### IF PUPPETMASTER
|
||||
if [ $(which puppetmaster) ]; then
|
||||
if [ $(command -v puppetmaster) ]; then
|
||||
MSG=$(process_info "puppetmaster" '')
|
||||
MSG=$(service_info "8140" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
|
@ -136,7 +140,7 @@ fi
|
|||
### IF PUPPETMASTER
|
||||
|
||||
### IF NFS Server
|
||||
if [ $(which nfsd) ]; then
|
||||
if [ $(command -v nfsd) ]; then
|
||||
MSG=$(process_info "nfsd" '')
|
||||
MSG=$(service_info "111 2049" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
|
@ -144,7 +148,7 @@ fi
|
|||
### FI NFS Server
|
||||
|
||||
### IF TFTPD
|
||||
if [ $(which in.tftpd) ]; then
|
||||
if [ $(command -v in.tftpd) ]; then
|
||||
MSG=$(process_info "in.tftpd" '')
|
||||
#MSG=$(service_info "69" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
|
@ -152,7 +156,7 @@ fi
|
|||
### FI TFTPD
|
||||
|
||||
### IF SQUID3
|
||||
if [ $(which squid3) ]; then
|
||||
if [ $(command -v squid3) ]; then
|
||||
MSG=$(process_info "squid3" '')
|
||||
MSG=$(service_info "3128" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
|
@ -160,7 +164,7 @@ fi
|
|||
### FI SQUID3
|
||||
|
||||
### IF APT-CACHER-NG
|
||||
if [ $(which apt-cacher-ng) ]; then
|
||||
if [ $(command -v apt-cacher-ng) ]; then
|
||||
MSG=$(process_info "apt-cacher-ng" '')
|
||||
MSG=$(service_info "3142" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
|
@ -168,7 +172,7 @@ fi
|
|||
### FI APT-CACHER-NG
|
||||
|
||||
### IF SSHD
|
||||
if [ $(which sshd) ]; then
|
||||
if [ $(command -v sshd) ]; then
|
||||
MSG=$(process_info "sshd" '')
|
||||
MSG=$(service_info "22" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
|
@ -176,21 +180,21 @@ fi
|
|||
### FI SSHD
|
||||
|
||||
### IF DHCPD
|
||||
if [ $(which dhcpd) ]; then
|
||||
if [ $(command -v dhcpd) ]; then
|
||||
MSG=$(process_info "dhcpd" '')
|
||||
printf '%b' "\n${MSG}"
|
||||
fi
|
||||
### FI DHCPD
|
||||
|
||||
### IF FAIL2BAN
|
||||
if [ $(which fail2ban-server) ]; then
|
||||
if [ $(command -v fail2ban-server) ]; then
|
||||
MSG=$(process_info "fail2ban" '')
|
||||
printf '%b' "\n${MSG}"
|
||||
fi
|
||||
### FI FAIL2BAN
|
||||
|
||||
### IF ETHERPAD
|
||||
if [ $(which etherpad) ]; then
|
||||
if [ $(command -v etherpad) ]; then
|
||||
MSG=$(process_info "etherpad" '')
|
||||
MSG=$(service_info "9001" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
|
@ -198,7 +202,7 @@ fi
|
|||
### FI ETHERPAD
|
||||
|
||||
### IF ETHERCALC
|
||||
if [ $(which ethercalc) ]; then
|
||||
if [ $(command -v ethercalc) ]; then
|
||||
MSG=$(process_info "ethercalc" '')
|
||||
MSG=$(service_info "8000" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
|
@ -206,7 +210,7 @@ fi
|
|||
### FI ETHERCALC
|
||||
|
||||
### IF GITLAB
|
||||
if [ $(which gitlab-ctl) ]; then
|
||||
if [ $(command -v gitlab-ctl) ]; then
|
||||
MSG=$(process_info "nginx" '')
|
||||
MSG=$(service_info "80 443" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
|
@ -216,7 +220,7 @@ fi
|
|||
### FI GITLAB
|
||||
|
||||
### IF XYMONSERVER
|
||||
if [ $(which xymond) ]; then
|
||||
if [ $(command -v xymond) ]; then
|
||||
MSG=$(process_info "xymond" '')
|
||||
MSG=$(service_info "1984" "${MSG}")
|
||||
printf '%b' "\n${MSG}"
|
||||
|
@ -224,7 +228,7 @@ fi
|
|||
### FI XYMONSERVER
|
||||
|
||||
### IF XYMONCLIENT
|
||||
if [ $(which xymon) ]; then
|
||||
if [ $(command -v xymon) ]; then
|
||||
MSG=$(process_info "xymonlaunch" '')
|
||||
printf '%b' "\n${MSG}"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue