15 customizing nagios, 1 changing the nagios user – HP Insight Control Software for Linux User Manual
Page 173
15 Customizing Nagios
The
configuration is designed so that you can customize it as needed.
Complete documentation for customizing Nagios is available on the following Nagios website:
This chapter addresses the following topics:
•
“Changing the Nagios user” (page 173)
•
“Adjusting the Nagios configuration” (page 175)
•
“Changing Nagios default settings” (page 179)
•
“Changing the rotation of system event logs and changing the rules file” (page 180)
•
“Controlling Nagios messages” (page 181)
•
“Modifying the Nagios password file” (page 181)
15.1 Changing the Nagios user
The Nagios user name and user ID are established when you configured HP Insight Control for
Linux services. However, you can configure HP Insight Control for Linux to use an alternate
nagios
user and group account.
You can change the default Nagios user by editing the following files on the CMS and on each
:
/opt/hptc/nagios/etc/nagios_vars.ini
/etc/sudoers
/opt/hptc/nagios/etc/nrpe.cfg
/opt/hptc/nagios/etc/nagios.cfg
/opt/hptc/nagios/etc/nsca.cfg
/opt/hptc/nagios/etc/nand.cfg
/opt/hptc/nagios/etc/nagios_monitor.cfg
The procedure is as follows:
1.
Log in as root on the CMS.
2.
Use the text editor of your choice to edit the /opt/hptc/nagios/etc/nagios_vars.ini
file to change the assignment of the nagios_user variable, which is as follows by default:
nagios_user = 222:nagios:222:hpadm
Save the file.
3.
Edit the last line of the /etc/sudoers files to change the account name of the Nagios user
in the last line.
NOTE:
This representation uses continuation characters (\) to portray this line on multiple
lines for clarity.
new_nagios_user ALL = NOPASSWD: CHECKALLSSHKEYS,\
CHECKSYSLOGALERTS,CHECKSFS,CHECKLSF,CHECKICMP,CHECKSEL,CHECKSELMON,CHECKLVS,SENSORS,\
CHECKHOSTS,RRDSWSETUP,SWITCHPOLLER,SCONTROL,POWEROFF,HPASMCLI # HP-HPTC-Nagios
Where new_nagios_user is the account name of the new Nagios user.
4.
Edit the /opt/hptc/nagios/etc/nrpe.cfg file to change the assignment of the
nrpe_user
and nrpe_groupvariables as follows:
# NRPE USER
# This determines the effective user that the NRPE daemon should run as.
# You can either supply a username or a UID.
#
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd
15.1 Changing the Nagios user
173