Skip to content

Commit

Permalink
Add nagios user in nagios group #22
Browse files Browse the repository at this point in the history
  • Loading branch information
davoult committed Mar 30, 2021
1 parent fe127f5 commit edca389
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions eonconf.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions eonconf/eonconf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions nagios/nagiosconf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}*
Expand Down

0 comments on commit edca389

Please sign in to comment.