diff --git a/eonconf.spec b/eonconf.spec index db0abaf..19c5e16 100644 --- a/eonconf.spec +++ b/eonconf.spec @@ -89,6 +89,8 @@ case "$1" in cat /dev/null >/srv/eyesofnetwork/nagios/etc/objects/switch.cfg cat /dev/null >/srv/eyesofnetwork/nagios/etc/objects/templates.cfg cat /dev/null >/srv/eyesofnetwork/nagios/etc/objects/windows.cfg + ## Adding Nagios in nagios group + gpasswd -a nagios nagios ;; esac diff --git a/eonconf/eonconf.sh b/eonconf/eonconf.sh index a067714..6407966 100755 --- a/eonconf/eonconf.sh +++ b/eonconf/eonconf.sh @@ -42,13 +42,6 @@ authCommunity log,execute,net EyesOfNetwork traphandle default /srv/eyesofnetwork/snmptt/bin/snmptthandler" > /etc/snmp/snmptrapd.conf sed -i 's/net_snmp_perl_enable = 0/net_snmp_perl_enable = 1/g' /etc/snmp/snmptt.ini -# --- disable Nagios default configuration -cat /dev/null > /srv/eyesofnetwork/nagios/etc/objects/localhost.cfg -cat /dev/null > /srv/eyesofnetwork/nagios/etc/objects/printer.cfg -cat /dev/null > /srv/eyesofnetwork/nagios/etc/objects/switch.cfg -cat /dev/null > /srv/eyesofnetwork/nagios/etc/objects/templates.cfg -cat /dev/null > /srv/eyesofnetwork/nagios/etc/objects/windows.cfg - # --- check mysql daemon is up and running, set the root password if [ ! -n "`systemctl status mariadb | grep pid`" ]; then systemctl start mariadb diff --git a/nagios/nagiosconf.sh b/nagios/nagiosconf.sh index 9ef148c..baef722 100755 --- a/nagios/nagiosconf.sh +++ b/nagios/nagiosconf.sh @@ -26,11 +26,19 @@ mv /etc/httpd/conf.d/nagios.conf /etc/httpd/conf.d/nagios.conf.orig cp -arf ${eonconfdir}/nagios.conf /etc/httpd/conf.d/ rsync -Pavz ${eonconfdir}/etc/ --delete ${linkdir}/etc/ +# disable Nagios default configuration +cat /dev/null > /srv/eyesofnetwork/nagios/etc/objects/localhost.cfg +cat /dev/null > /srv/eyesofnetwork/nagios/etc/objects/printer.cfg +cat /dev/null > /srv/eyesofnetwork/nagios/etc/objects/switch.cfg +cat /dev/null > /srv/eyesofnetwork/nagios/etc/objects/templates.cfg +cat /dev/null > /srv/eyesofnetwork/nagios/etc/objects/windows.cfg + # icons tar zxvf ${eonconfdir}/logos.tgz -C ${linkdir}/share/images/logos/ # user /usr/sbin/usermod -g ${APPLIANCEGRP} -G apache nagios &>/dev/null +/usr/bin/gpasswd -a nagios nagios &>/dev/null # rights chown -R nagios:${APPLIANCEGRP} ${linkdir}*