Thanks for visiting the site !!! Visit below intrested Ads to support us if you like the site .Sharing is caring .keep distance and keep safe . Happy Learning ... 😀

NAGIOS AGENT INSTALLATION ( SUSE LINUX)

Refer below steps for Nagios Agent installation on Suse Linux server.

STEP 1

host01:~ # zypper search nrpe 

Loading repository data… 

Reading installed packages… 

S | Name                | Summary                                              | Type      

–+———————+——————————————————+———– 

  | nagios-nrpe         | Nagios Remote Plug-In Executor                       | package   

  | nagios-nrpe         | Nagios Remote Plug-In Executor                       | srcpackage 

  | nagios-nrpe-doc     | Nagios Remote Plug-In Executor documentation         | package   

  | nagios-plugins-nrpe | Nagios NRPE plugin                                   | package   

  | slessp1-nagios-nrpe | Optional update for nagios-nrpe                      | patch     

  | slessp2-nagios-nrpe | Security update for nagios-nrpe, nagios-plugins-nrpe | patch   

STEP 2

host01:~ # zypper install nagios-nrpe nagios-plugins-nrpe 

Loading repository data… 

Reading installed packages… 

Resolving package dependencies… 

The following NEW packages are going to be installed: 

  apache2 apache2-prefork apache2-utils libapr-util1 libapr1 nagios nagios-nrpe nagios-plugins nagios-plugins-nrpe nagios-www perl-Crypt-DES perl-Net-SNMP 

The following recommended packages were automatically selected: 

  apache2-prefork nagios nagios-plugins nagios-www 

12 new packages to install. 

Overall download size: 4.5 MiB. After the operation, additional 16.4 MiB will be used. 

Continue? [y/n/?] (y): y 

Retrieving package perl-Crypt-DES-2.05-1.22.x86_64 (1/12), 19.0 KiB (39.0 KiB unpacked) 

Retrieving: perl-Crypt-DES-2.05-1.22.x86_64.rpm [done] 

Retrieving package perl-Net-SNMP-5.2.0-1.15.x86_64 (2/12), 97.0 KiB (389.0 KiB unpacked) 

Retrieving: perl-Net-SNMP-5.2.0-1.15.x86_64.rpm [done (23.0 KiB/s)] 

Retrieving package libapr1-1.3.3-11.18.19.8.x86_64 (3/12), 125.0 KiB (297.0 KiB unpacked) 

Retrieving: libapr1-1.3.3-11.18.19.8.x86_64.rpm [done (62.5 KiB/s)] 

Retrieving package nagios-nrpe-2.12-24.4.8.1.x86_64 (4/12), 35.0 KiB (56.0 KiB unpacked) 

Retrieving: nagios-nrpe-2.12-24.4.8.1.x86_64.rpm [done] 

Retrieving package nagios-plugins-nrpe-2.12-24.4.8.1.x86_64 (5/12), 20.0 KiB (38.0 KiB unpacked) 

Retrieving: nagios-plugins-nrpe-2.12-24.4.8.1.x86_64.rpm [done] 

Retrieving package nagios-3.0.6-1.25.34.1.x86_64 (6/12), 298.0 KiB (4.3 MiB unpacked) 

Retrieving: nagios-3.0.6-1.25.34.1.x86_64.rpm [done (84.9 KiB/s)] 

Retrieving package nagios-plugins-1.4.13-1.37.1.x86_64 (7/12), 401.0 KiB (1.9 MiB unpacked) 

Retrieving: nagios-plugins-1.4.13-1.37.1.x86_64.rpm [done (61.0 KiB/s)] 

Retrieving package libapr-util1-1.3.4-12.22.21.2.x86_64 (8/12), 93.0 KiB (208.0 KiB unpacked) 

Retrieving: libapr-util1-1.3.4-12.22.21.2.x86_64.rpm [done (24.1 KiB/s)] 

Retrieving package apache2-utils-2.2.12-1.48.1.x86_64 (9/12), 123.0 KiB (192.0 KiB unpacked) 

Retrieving: apache2-utils-2.2.12-1.48.1.x86_64.rpm [done] 

Retrieving package apache2-2.2.12-1.48.1.x86_64 (10/12), 769.0 KiB (2.3 MiB unpacked) 

Retrieving: apache2-2.2.12-1.48.1.x86_64.rpm [done (162.9 KiB/s)] 

Retrieving package apache2-prefork-2.2.12-1.48.1.x86_64 (11/12), 283.0 KiB (669.0 KiB unpacked) 

Retrieving: apache2-prefork-2.2.12-1.48.1.x86_64.rpm [done (124.1 KiB/s)] 

Retrieving package nagios-www-3.0.6-1.25.34.1.x86_64 (12/12), 2.3 MiB (6.1 MiB unpacked) 

Retrieving: nagios-www-3.0.6-1.25.34.1.x86_64.rpm [done (220.6 KiB/s)] 

Installing: perl-Crypt-DES-2.05-1.22 [done] 

Installing: perl-Net-SNMP-5.2.0-1.15 [done] 

Installing: libapr1-1.3.3-11.18.19.8 [done] 

Installing: nagios-nrpe-2.12-24.4.8.1 [done] 

Additional rpm output: 

insserv: script sapinit_14082012: service sapinit already provided! 

Installing: nagios-plugins-nrpe-2.12-24.4.8.1 [done] 

Installing: nagios-3.0.6-1.25.34.1 [done] 

Additional rpm output: 

Updating etc/sysconfig/nagios… 

insserv: script sapinit_14082012: service sapinit already provided! 

Installing: nagios-plugins-1.4.13-1.37.1 [done] 

Installing: libapr-util1-1.3.4-12.22.21.2 [done] 

Installing: apache2-utils-2.2.12-1.48.1 [done] 

Installing: apache2-2.2.12-1.48.1 [done] 

Additional rpm output: 

Starting SuSEconfig, the SuSE Configuration Tool… 

Running module permissions only 

Reading /etc/sysconfig and updating the system… 

Executing /sbin/conf.d/SuSEconfig.permissions… 

Finished. 

Updating etc/sysconfig/apache2… 

insserv: script sapinit_14082012: service sapinit already provided! 

looking for old 2.0 modules to be renamed… 

Done. 

Installing: apache2-prefork-2.2.12-1.48.1 [done] 

Installing: nagios-www-3.0.6-1.25.34.1 [done] 

STEP 3

host01:~ # rpm -qa | grep nrpe 

nagios-plugins-nrpe-2.12-24.4.8.1 

nagios-nrpe-2.12-24.4.8.1 

STEP 4    

host01:~ # passwd nagios 

Changing password for nagios. 

New Password: 

Bad password: too simple 

Reenter New Password: 

Password changed. 

host01:~ # grep -i nagios /etc/group 

nagios:!:111: 

host01:~ # grep nagios /etc/passwd 

nagios:x:108:111:User for Nagios:/var/lib/nagios:/bin/false 

STEP 5

host01:~ # usermod -s /bin/bash nagios 

host01:~ # grep nagios /etc/passwd 

nagios:x:108:111:User for Nagios:/var/lib/nagios:/bin/bash 

STEP 6

host01:~ # mv /etc/nagios/nrpe.cfg /etc/nagios/nrpe.cfg.old 

host01:~ # copy the below script to  /etc/nagios/nrpe.cfg 

STEP 7

Go to the directory /etc/nagios

host01:/etc/nagios # vi config 

Copy the below contect to the config file

$protocolsdir = ‘/etc/nagios/check_logfiles’; 

$seekfilesdir = ‘/etc/nagios/check_logfiles’; 

@searches = ( 

 { 

        type => ‘simple’, 

        logfile => ‘/var/log/messages’, 

        criticalpatterns => [‘PANIC’], 

        } 

);

STEP 8

  Edit the file /etc/xinetd.d/nrpe

————————————-

# default: off 

# description: NRPE (Nagios Remote Plugin Executor) 

service nrpe 

        flags           = REUSE 

        socket_type     = stream 

        type            = UNLISTED 

        port            = 5666 

        wait            = no 

        user            = nagios 

        group           = nagios 

        server          = /usr/sbin/nrpe 

        server_args     = -c /etc/nagios/nrpe.cfg –inetd 

        log_on_failure  += USERID 

        disable         = no 

        #only_from       = 127.0.0.1 

STEP 9

host01:~ # setfacl -m u:nagios:r–  /var/log/messages

STEP 10

cd /usr/lib/nagios/

mv  plugins  plugins.old 

copy the plugin folder from some other server using scp and copied to /usr/lib/nagios/

STEP 11

host01:/usr/lib # chown -R nagios:nagios nagios 

host01:/usr # cd /etc/xinetd.d/ 

host01:/etc/xinetd.d # chown -R nagios:nagios nrpe

host01:/etc/nagios#cp nrpe.cfg  from any other server  

STEP 12

cd /etc

host01:/etc # chown -R nagios:nagios nagios 

STEP 13

host01:/etc # service nrpe status 

Checking for service Nagios NRPE                                                                                                                                         unused 

host01:/etc # service nrpe start 

Starting Nagios NRPE                                                                                                                                                     done 

host01:/etc # chkconfig nrpe on 

STEP 14

host01:/usr/lib/nagios # netstat -tulpn | grep :5666 

tcp        0      0 0.0.0.0:5666            0.0.0.0:*               LISTEN      26916/nrpe 

STEP 15

visudo 

nagios ALL= NOPASSWD: /etc/init.d/nrpe, /etc/init.d/xinetd

STEP 16

Verify 

nagios@host02:~> sudo /etc/init.d/nrpe status 

Checking for service Nagios NRPE                                                                                                                                                          running 

nagios@host02:~> sudo /etc/init.d/nrpe restart 

 su – nagios 

nagios@host03:~> /usr/lib/nagios/plugins/check_logfiles -f /etc/nagios/config 

OK – no errors or warnings|default_lines=0 default_warnings=0 default_criticals=0 default_unknowns=0 

nagios@host03:~> 

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *