Jumat, 24 Maret 2017

How To Install As Well As Configure Pnp4nagios Bulk+Npcd Trend Amongst Nagios4.X Centos 7.X

PNP4NAGIOS:-

Pnp4Nagios plant alongside Nagios to generate the graph of services that are beingness monitored yesteryear Nagios server. With the handle of Pnp4Nagios, nosotros tin meet the graph anytime whenever needed,  It tape graph for all the configured services, We tin sentiment usage similar CPU, RAM, Disk Space etc.

Prerequisites:  

1- RRDTOOL, rrdtool-perl
2- Perl
3- Php-gd
4- perl-time-HiRes

Step 1-  Installation
To Install prerequisites run below command
[root@localhost  ]# yum install rrdtool perl-Time-HiRes rrdtool-perl php-gd

Once prerequisites installation done, download pnp4nagios.
Step 2- Download PNP4Nagios, Extract in addition to Install
[root@localhost  ]# wget https://sourceforge.net/projects/pnp4nagios/files/PNP-0.6/pnp4nagios-0.6.25.tar.gz
Once download transcend finished, extract packet using ascendancy below
[root@localhost  ]# tar zxfv pnp4nagios-0.6.25.tar.gz
Go to the Extracted directory in addition to configure it.
[root@localhost  ]# cd pnp4nagios-0.6.25
Configure pnp4nagios in addition to install using ascendancy below
[root@localhost pnp4nagios]# ./configure [root@localhost pnp4nagios]# brand all [root@localhost pnp4nagios]# brand fullinstall

Enable NPCD service to starting fourth dimension at kick fourth dimension in addition to starting fourth dimension it now.
[root@localhost  ]# chkconfig --add npcd && chkconfig --level 35 npcd on

Let's reboot httpd service.
[root@localhost  ]# systemctl restart httpd

Step 2- Let's depository fiscal establishment lucifer PNP4Nagios installation.

Open browser in addition to type URL:- 192.168.102.11/pnp4nagios/











































After successful PNP4Nagios installation, you lot volition transcend the window similar above.

Step 3- Let's rename install.php to install.php-bak
[root@localhost  ]# mv  /usr/local/pnp4nagios/share/install.php /usr/local/pnp4nagios/share/install.php-bak

Step 4-  Make the required changes inward Nagios configuration to integrate PNP4Nagios to generate graph.

Make the changes inward nagios.cfg configuration file.
[root@localhost  ]# vi /usr/local/nagios/etc/nagios.cfg
Change the Process_performance_data=1 in addition to append below mentions line.
# Bulk / NPCD mode process_performance_data=1 service_perfdata_file=/usr/local/pnp4nagios/var/service-perfdata service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECH$ service_perfdata_file_mode=a service_perfdata_file_processing_interval=15 service_perfdata_file_processing_command=process-service-perfdata-file  host_perfdata_file=/usr/local/pnp4nagios/var/host-perfdata host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$ host_perfdata_file_mode=a host_perfdata_file_processing_interval=15 host_perfdata_file_processing_command=process-host-perfdata-file
Save in addition to leave of absence from file.
Now brand the required changes inward command.cfg file
[root@localhost  ]# vi /usr/local/nagios/etc/objects/commands.cfg
Go to the terminate of file in addition to append the crimson business below in addition to comment all the dark line.
# 'process-host-perfdata' ascendancy Definition #define command{ #       command_name    process-host-perfdata #       command_line    /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /usr/local/nagios/var/host-perfdata.out #       }   # 'process-service-perfdata' ascendancy Definition #define command{ #       command_name    process-service-perfdata #       command_line    /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /usr/local/nagios/var/service-perfdata.out #       }  # 'process-host-perfdata' ascendancy Definition define command{ command_name process-host-perfdata command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$$ }  # 'process-service-perfdata' ascendancy Definition define command{ command_name process-service-perfdata command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$$ }  define command{ command_name process-service-perfdata-file command_line /bin/mv /usr/local/pnp4nagios/var/service-perfdata /usr/local/pnp4nagios/var/spool/service-perfdata.$TIMET$ }  define command{ command_name process-host-perfdata-file command_line /bin/mv /usr/local/pnp4nagios/var/host-perfdata /usr/local/pnp4nagios/var/spool/host-perfdata.$TIMET$ }   

Let's brand alter inward template.cfg file 
[root@localhost  ]# vi /usr/local/nagios/etc/objects/templates.cfg
Append the crimson business inward the below of file.
# PNP4NAGIOS # define host { hollo host-pnp action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=_HOST_ register 0 }  define service { hollo srv-pnp action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$ register 0 
Save in addition to Exit from file

Now brand the alter inward the host configuration fiel
[root@localhost  ]# vi /usr/local/nagios/etc/objects/localhost.cfg

Append the next lines inward the terminate of file.
# Define a host for the local machine  define host{         purpose                     linux-server,host-pnp            ; Name of host template to purpose                                                         ; This host Definition volition inherit all variables that are defined                                                         ; inward (or inherited by) the linux-server host template definition.         host_name               localhost         alias                   localhost         address                 127.0.0.1         } 

# Define a service to "ping" the local machine
define service{
        purpose                             local-service,srv-pnp         ; Name of service template to use
        host_name                       localhost
        service_description             PING
        check_command                   check_ping!100.0,20%!500.0,60%
        }
Save in addition to leave of absence from file.

All the configuration changed completed successfully.

Step 5-  Now restart httpd, Nagios in addition to Npcd service using ascendancy below.
[root@localhost  ]# systemctl restart httpd && systemctl restart nagios && systemctl restart npcd

Step 6- Verify integration of PNP4Nagios

Open Nagios server URL:-  http://192.168.102.11/nagios/

After successful integration of PNP4nagios you lot transcend a graph symbol for each service similar inward below image:







And you lot volition meet graph for private service icon similar below:























Congratulation!!! Installation in addition to Integration of PNP4Nagios alongside Nagios server completed successfully done alongside Bulk+NPCD mode.


Sumber https://linuxhowtoguide.blogspot.com/

Jumat, 17 Maret 2017

How To Install Nagios 3.X On Centos 6.7 End Release

What Is Nagios Core:-

Nagios Core is an Open Source organization together with network monitoring application. It watches hosts together with services that yous specify, alerting yous when things become bad together with when they instruct better.

System Requirments:-

1- Linux machine (In my illustration I am using Centos 6.7)
2- HTTPd, PHP amongst gd together with CGI.

Nagios Installation:-

 Step 1- 
Add repository showtime to install Nagios
[root@odoo  ]# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm Retrieving http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm warning: /var/tmp/rpm-tmp.2nIBRS: Header V3 RSA/SHA256 Signature, fundamental ID 0608b895: NOKEY Preparing...                ########################################### [100%]    1:epel-release           ########################################### [100%] [root@odoo  ]# 

[root@odoo  ]# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm Retrieving http://rpms.famillecollet.com/enterprise/remi-release-6.rpm warning: /var/tmp/rpm-tmp.f5McIF: Header V4 DSA/SHA1 Signature, fundamental ID 00f97f56: NOKEY Preparing...                ########################################### [100%]    1:remi-release           ########################################### [100%] 

 Step 2- Complete installation & configuration part:

Run yum update
[root@odoo  ]# yum update
Install HTTPd server
[root@odoo  ]# yum install httpd
Install PHP
[root@odoo  ]# yum install php php-cli php-gh php-common

Install Nagios
[root@odoo  ]# yum install nagios nagios-plugins-all nagios-plugins-nrpe nrpe
Check Nagios version
[root@odoo  ]# nagios -v
Enable httpd together with Nagios service to laid about car during organization boot or restart
[root@odoo  ]# chkconfig httpd on && chkconfig nagios on
Start httpd & Nagios service
[root@odoo  ]# service httpd laid about && service nagios start
Open Port fourscore through iptables
[root@odoo  ]# vi /etc/sysconfig/iptables
Modify config file similar below
# Firewall configuration written past times system-config-firewall # Manual customization of this file is non recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m field --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m field --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -m field --state NEW -m tcp -p tcp --dport fourscore -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT 

Save together with kicking the bucket from file & restart iptables service
[root@odoo  ]# service iptables restart
 Step 3- Setup Nagios login details
 Set Nagios user get upwards together with password
[root@odoo  ]# htpasswd -c /etc/nagios/passwd nagiosadmin New password: ******* Re-type novel password:  ****** Adding password for user nagiosadmin 

 Step 4- Validate authentication & installation.
Check Nagios login using URL below















After successful authentication, yous volition instruct the window similar below.













!!!!!!!! Installation of Nagios completed successfully !!!!!!!!


Sumber https://linuxhowtoguide.blogspot.com/