Friday, 5 April 2019

Install Cacti (Network Monitoring) on RHEL/CentOS 7.x/6.x/5.x and Fedora


Cacti tool is an open source web based network monitoring and system monitoring graphing solution for IT business. Cacti enables a user to poll services at regular intervals to create graphs on resulting data using RRDtool. Generally, it is used to graph time-series data of metrics such as network bandwidth utilization, CPU load, running processes, disk space etc.
In this how-to we are going to show you how to install and setup complete network monitoring application called Cacti using Net-SNMP tool on RHEL 7.x/6.x/5.x, CentOS 7.x/6.x/5.x and Fedora systems using YUM package manager tool.

The Cacti required several packages to be installed on your Linux operating systems like RHEL / CentOS / Fedora.

# yum install httpd httpd-devel
# yum install mysql mysql-server

MariaDB is a community-developed fork of
the MySQL database project, and provides a replacement for MySQL. Previously
the official supported database was MySQl under RHEL/CentOS 6.x/5.x
and Fedora.

Recently, RedHat makes a new transaction from MySQl to MariaDB, as MariaDB is the default implementation of MySQL in RHEL/CentOS 7.x and Fedora 19 onwards.

# yum install mariadb-server –y
# yum install php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli
# yum install php-snmp
# yum install net-snmp-utils net-snmp-libs
# yum install rrdtool

Once you’ve installed all the required software’s for Cacti installation, lets start them one-by-one using following commands.

# service httpd start
# service mysqld start
# service snmpd start

Configuring Apache, MySQL and SNMP Services to start on boot.

# /sbin/chkconfig --levels 345 httpd on
# /sbin/chkconfig --levels 345 mysqld on
# /sbin/chkconfig --levels 345 snmpd on

Here,
you need to install and enable EPEL Repository. Once you’ve enabled repository,
type the following command to install Cacti application.

# yum install cacti

Extract the distribution tarball.

# tar xzvf cacti-version.tar.gz

We need to configure MySQL for Cacti, to do this we need to set password for our newly installed MySQL server and then we will create Cacti database with user Cacti.

# mysqladmin -u root password your-password-here
# mysql -u root –p

mysql> create database cacti;
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'cacti';
mysql> FLUSH privileges;
mysql> quit;

# rpm -ql cacti | grep cacti.sql

Now we’ve of the location of Cacti.sql file, type the following command to install tables, here you need to type the Cacti user password.

# mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql

Open
the file called /etc/cacti/db.php with any editor. 
# vi /etc/cacti/db.php

Make
the following changes and save the file. Make sure you set password correctly.

/* make sure these values reflect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "your-password-here";
$database_port = "3306";
$database_ssl = false;

Now configuring firewall for Cacti

# iptables -A INPUT -p udp -m state --state NEW --dport 80 -j ACCEPT
# iptables -A INPUT -p tcp -m state --state NEW --dport 80 -j ACCEPT
# service iptables save

#service httpd restart

Set the appropriate permissions on cacti's directories for graph/log generation. You should execute these commands from inside cacti's directory to change the permissions. 

shell> chown -R cactiuser rra/ log/
(Enter a valid username for cactiuser, this user will also be used in the next step for data gathering.)

Add a line to your /etc/crontab file similar to:
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1

Replace cactiuser with the valid user specified in the previous step.

Replace /var/www/html/cacti/ with your full Cacti path.

Finally, Cacti is ready, just go to

http://your-IP-Here/cacti/

Log in the with a username/password of admin. You will be required to change this password immediately. Make sure to fill in all of the path variables carefully and correctly on the following screen.

LACP Portchannel Configuration VMware Interface to Cisco

Use the link aggregation feature to aggregate one or more Ethernet interfaces to form a logical point-to-point link, known as a LAG, virtual link, or bundle. We would like to add LACP EtherChannels to one of my 2960 switches to connect VMWare ESXi (vSphere 6.5) host’s via teamed NICs.




Does enabling Route based on IP hash without 802.ad aggregation or vise-versa disrupt networking?
Yes, if you must enable 802.ad Static mode ON and configure the vSwitch to route based on IP Hash, configure route based on IP hash inside ESX/ESXi first, then enable the LAG on the physical network. You will loose connectivity to the ESX/ESXi host temporarily until you configure the physical side.

Does VMware support any other algorithm other than IP HASH when using EtherChannel?
No, only route based on IP hash is supported when configuring based on EtherChannel.

How many Ether channels exist per vSwitch or vSphere Distributed Switch (vDS)?
One and only one Ether channel per vSwitch or vDS.

Can I use beacon probing with IP Hash load balancing?
No. Beacon probing with IP Hash load balancing is not supported. Beacon probing is most useful in detecting networking failures which do not result in a link down condition. This could be a mis-configuration resulting in link that is still up, but not operating as expected.

What is the difference between Active and Passive Mode for LACP configuration?
Active - The port will actively negotiate the link state by initiating negotiation and send LACP frames.
Passive - The port is passive state and will respond to LACP frames sent during LACP negotiation.

Can I configure standby or unused up-links while using IP Hash?
No. Do not configure standby or unused up-links with IP Hash. IEEE 802.3ad dynamic: Only supported in ESXi 5.1 vDS. Pior to ESXi 5.1 VMware only supported static link aggregation. With ESXi 5.1 Dynamic LACP is supported only vSphere Distributed Switches (vDS). Static LAG are still supported on vSwithes and vDS. Dynamic LACP provides additional support for Plug and Play automatic configuration and negotiation between host and physical switch. Dynamic LACP will detect link failures and cabling errors and automatically reconfigure the links.

Thursday, 4 April 2019

Cisco and Huawei Port channel Configuration


Configuring a LACP link aggregation, EtherChannel, or port-channel or Eth-trunk between Huawei and Cisco switch is something very common but the configuration syntax between the two vendors is different, it can be confusing.