A customizing nagios, A.1 changing the nagios user – HP Insight Control Software for Linux User Manual

Page 267

Advertising
background image

A Customizing Nagios

The

Nagios

configuration is designed so that you can customize it as needed.

Complete documentation for customizing Nagios is available on the following Nagios website:

www.nagios.org

This appendix addresses the following topics:

“Changing the Nagios user” (page 267)

“Adjusting the Nagios configuration” (page 269)

“Changing Nagios default settings” (page 272)

“Changing the rotation of system event logs and changing the rules file” (page 273)

“Controlling Nagios messages” (page 274)

“Modifying the Nagios password file” (page 274)

A.1 Changing the Nagios user

The Nagios user name and user ID are established when you configured Insight Control for
Linux services. However, you can configure 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

management hub

:

/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

nrpe_user=new_nagios_user

A.1 Changing the Nagios user

267

Advertising