Skip to content

Commit

Permalink
Handle empty/default Hostname parameter
Browse files Browse the repository at this point in the history
See issue #6
  • Loading branch information
red15 authored Jan 29, 2021
1 parent 404dfa2 commit 5e0c60c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions check-yum-updates/check-yum-updates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
### Set Some Variables ###
ZBX_DATA=/tmp/zabbix-sender-yum.data
HOSTNAME=$(egrep ^Hostname= /etc/zabbix/zabbix_agentd.conf | cut -d = -f 2)
if [[ "$HOSTNAME" == "" ]]
then
HOSTNAME=$(hostname)
fi
ZBX_SERVER_IP=$(egrep ^ServerActive /etc/zabbix/zabbix_agentd.conf | cut -d = -f 2)
RELEASE=$(cat "/etc/redhat-release")
ENFORCING=$(getenforce)
Expand Down

0 comments on commit 5e0c60c

Please sign in to comment.