Showing posts with label Fedora. Show all posts
Showing posts with label Fedora. Show all posts

Wednesday, 22 July 2020

Install Cacti (Network Monitoring) on RHEL/CentOS 8/7 and Fedora 30




Cacti tool is an open-source web-based network monitoring and system monitoring graphing solution for IT business. Cacti enable 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 set up a complete network monitoring application called Cacti using Net-SNMP tool on RHEL, CentOS and Fedora systems using YUM and DNF package manager tool.

Cacti Required Packages

The Cacti required the following packages to be installed on your Linux operating systems like RHEL / CentOS / Fedora.
  1. Apache : A Web server to display network graphs created by PHP and RRDTool.
  2. MySQL : A Database server to store cacti information.
  3. PHP : A script module to create graphs using RRDTool.
  4. PHP-SNMP : A PHP extension for SNMP to access data.
  5. NET-SNMP : A SNMP (Simple Network Management Protocol) is used to manage the network.
  6. RRDTool : A database tool to manage and retrieve time series data like CPU load, Network Bandwidth, etc.
Note: The installation instructions were shown here are written based on CentOS 7.5 Linux distribution.

Installing Cacti Required Packages on RHEL / CentOS / Fedora

First, we need to install following dependency packages one-by-one using the default package manager tool as shown.

Install Apache

# yum install httpd httpd-devel   [On RHEL/CentOS 7/6]
# dnf install httpd httpd-devel   [On RHEL/CentOS 8 and Fedora 30]

Install Apache Web Server in CentOS
Install Apache Web Server in CentOS

Install MySQL

# yum install mysql mysql-server      [On RHEL/CentOS 6]
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 and Fedora.
Recently, RedHat makes a new transaction from MySQL to MariaDB, as MariaDB is the default implementation of MySQL in RHEL/CentOS 8/7 and Fedora 19 onwards.
# yum install mariadb-server -y  [On RHEL/CentOS 7]
# dnf install mariadb-server -y         [On RHEL/CentOS 8 and Fedora 30]

Install MariaDB Server in CentOS
Install MariaDB Server in CentOS

Install PHP

# yum install php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli
OR
# dnf install php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli

Install PHP in CentOS
Install PHP in CentOS

Install PHP-SNMP

# yum install php-snmp
OR
# dnf install php-snmp         

Install SNMP in CentOS
Install SNMP in CentOS

Install NET-SNMP

# yum install net-snmp-utils net-snmp-libs
OR
# dnf install net-snmp-utils net-snmp-libs

Install Net SNMP in CentOS
Install Net SNMP in CentOS

Install RRDTool

# yum install rrdtool
OR
# dnf install rrdtool

Install RRDTool in CentOS
Install RRDTool in CentOS

Staring Apache, MySQL, and SNMP Services

Once you’ve installed all the required software’s for Cacti installation, let’s start them one-by-one using following commands.
On RHEL/CentOS 6 and Fedora 18-12
[root@tecmint ~]# service httpd start
[root@tecmint ~]# service mysqld start
[root@tecmint ~]# service snmpd start
On RHEL/CentOS 8/7 and Fedora 19 Onwards
[root@tecmint ~]# systemctl start httpd.service
[root@tecmint ~]# systemctl start mariadb.service
[root@tecmint ~]# systemctl start snmpd.service

Configure System Start-up Links

Configuring Apache, MySQL and SNMP Services to start on boot.
On RHEL/CentOS 6 and Fedora 18-12
[root@tecmint ~]# /sbin/chkconfig --levels 345 httpd on
[root@tecmint ~]# /sbin/chkconfig --levels 345 mysqld on
[root@tecmint ~]# /sbin/chkconfig --levels 345 snmpd on
On RHEL/CentOS 8/7 and Fedora 19 Onwards
[root@tecmint ~]# systemctl enable httpd.service
[root@tecmint ~]# systemctl enable mariadb.service
[root@tecmint ~]# systemctl enable snmpd.service

Install Cacti on RHEL / CentOS / Fedora

Here, you need to install and enable the EPEL Repository. Once you’ve enabled the repository, type the following command to install Cacti application.
# yum install cacti         [On RHEL/CentOS 7]
# dnf install cacti         [On RHEL/CentOS 8 and Fedora 30]

Install Cacti in CentOS
Install Cacti in CentOS

Configuring MySQL Server for Cacti Installation

We need to configure MySQL for Cacti, to do this we need to secure a newly installed MySQL server and then we will create Cacti database with user Cacti. If you’re MySQL is already installed and secured, then don’t need to do it again.
# mysql_secure_installation

Create MySQL Cacti Database

Login into MySQL server with a newly created password and create Cacti database with user Cacti and set the password for it.
On RHEL/CentOS 6 and Fedora 18-12
[root@tecmint ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database cacti;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'tecmint';
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit;
Bye
On RHEL/CentOS 8/7 and Fedora 19 Onwards
[root@tecmint ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.41-MariaDB MariaDB Server
Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database cacti;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'tecmint';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> quit;
Bye

Install Cacti Tables to MySQL

Find out the database file path using RPM command, to install cacti tables into newly created Cacti database, use the following command.
# rpm -ql cacti | grep cacti.sql
Sample Output:
/usr/share/doc/cacti-1.2.6/cacti.sql
OR
/usr/share/doc/cacti/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.
[root@tecmint ~]# mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql
Enter password:

Configure MySQL settings for Cacti

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 = "cacti";
$database_password = "your-password-here";
$database_port = "3306";
$database_ssl = false;

Configuring Firewall for Cacti

On RHEL/CentOS 6 and Fedora 18-12
[root@tecmint ~]# iptables -A INPUT -p udp -m state --state NEW --dport 80 -j ACCEPT
[root@tecmint ~]# iptables -A INPUT -p tcp -m state --state NEW --dport 80 -j ACCEPT
[root@tecmint ~]# service iptables save
On RHEL/CentOS 8/7 and Fedora 19 Onwards
[root@tecmint ~]# firewall-cmd --permanent --zone=public --add-service=http
[root@tecmint ~]# firewall-cmd --reload

Configuring Apache Server for Cacti Installation

Open file called /etc/httpd/conf.d/cacti.conf with your choice of editor.
# vi /etc/httpd/conf.d/cacti.conf
You need to enable access to Cacti application for your local network or per IP level. For example, we’ve enabled access to our local LAN network 172.16.16.0/20. In your case, it would be different.
Alias /cacti    /usr/share/cacti
 
<Directory /usr/share/cacti/>
        Order Deny,Allow
        Deny from all
        Allow from 172.16.16.0/20
</Directory>
In the latest version of Apache (ex: Apache 2.4), you may need to change according to the following settings.
Alias /cacti    /usr/share/cacti

<Directory /usr/share/cacti/>
        <IfModule mod_authz_core.c>
                # httpd 2.4
                Require all granted
        </IfModule>
        <IfModule !mod_authz_core.c>
                # httpd 2.2
                Order deny,allow
                Deny from all
                Allow from all
        </IfModule>
</Directory>
Finally, restart the Apache service.
[root@tecmint ~]# service httpd restart    [On RHEL/CentOS 6 and Fedora 18-12]
[root@tecmint ~]# systemctl restart httpd.service  [On RHEL/CentOS 8/7 and Fedora 19 onwards]

Setting Cron for Cacti

Open file /etc/cron.d/cacti.
# vi /etc/cron.d/cacti
Uncomment the following line. The poller.php script runs every 5mins and collects data of known host which is used by Cacti application to display graphs.
#*/5 * * * *    cacti   /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

Running Cacti Installer Setup

Finally, Cacti is ready, just go to http://YOUR-IP-HERE/cacti/ & follow the installer instruction through the following screens. Enter the default login details and hit Enter button.
User: admin
Password: admin

Cacti User Login
Cacti User Login
Next, change default Cacti password.

Change Cacti Admin Password
Change Cacti Admin Password
Accept Cacti License Agreement.

Accept Cacti License Agreement
Accept Cacti License Agreement
Next, the screen shows Pre-installation Checks for Cacti installation, please correct the suggested settings in your /etc/php.ini file as shown and restart Apache after making changes.
memory_limit = 800M
max_execution_time = 60
date.timezone = Asia/Kolkata

Cacti Pre-installation Checks
Cacti Pre-installation Checks
Similarly, you also need to grant access to the MySQL TimeZone database for user Cacti, so that the database is populated with global TimeZone information.
mysql> use mysql;
mysql> GRANT SELECT ON mysql.time_zone_name TO cacti@localhost;
mysql> flush privileges;

Cacti MySQL Pre-Installation Checks
Cacti MySQL Pre-Installation Checks
Please choose the installation Type as “New Install“.

Select Cacti Installation Type
Select Cacti Installation Type
Make sure all the following directory permissions are correct before continuing.

Cacti Directory Permission Checks
Cacti Directory Permission Checks
Make sure all of these Critical Binary Locations and Versions values are correct before continuing.

Critical Binary Locations and Versions
Critical Binary Locations and Versions
Please choose the default Data Source Profile to be used for polling sources.

Select Data Source Profile
Select Data Source Profile
Please, choose the Device Templates that you wish to use after the Cacti Install.

Select Cacti Device Templates
Select Cacti Device Templates
Set the Server Collation in your MySQL configuration file /etc/my.cnf under the [mysqld] section as shown.
[mysqld]
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci

Set Server Collation
Set Server Collation
Your Cacti Server is almost ready. Please confirm that you are happy to proceed.

Cacti Installation Process
Cacti Installation Process
Installing Cacti Server
Installing Cacti Server
Cacti Dashboard
Cacti Dashboard
For more information and usage please visit the Cacti Page.
Tags ,

Source : https://www.tecmint.com/install-cacti-network-monitoring-on-rhel-centos-fedora/

Saturday, 21 December 2013

Empty the Trash in Command Line

rm -fr /home/name/.local/share/Trash/info/* 
rm -fr /home/name/.local/share/Trash/files/*

Thursday, 22 August 2013

Install Google Chrome on Fedora 19/18/17/16

This howto explains howto install Google Chrome Web browser on Fedora 19/18/17/16. Best way to install and keep up-to-date with Google Chrome browser is use Google’s own YUM repository.

Enable Google YUM repository

Add following to /etc/yum.repos.d/google-chrome.repo file:
32-bit
[google-chrome]
name=google-chrome - 32-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/i386
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
64-bit
[google-chrome]
name=google-chrome - 64-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
Note: Both 32-bit and 64-bit repos can be placed in the same file.

Install Google Chrome with YUM (as root user)

Install Google Chrome Stable Version

## Install Google Chrome Stable version ##
yum install google-chrome-stable

Install Google Chrome Beta Version

## Install Google Chrome Beta version ##
yum install google-chrome-beta

Install Google Chrome Unstable Version

## Install Google Chrome Unstable version ##
yum install google-chrome-unstable
Source : http://www.if-not-true-then-false.com/2010/install-google-chrome-with-yum-on-fedora-red-hat-rhel/

Installing Citrix ICA Client on Fedora 17 (64-bit)

1. Enable RPMFusion repository
2. Install the dependencies:
Drop to a terminal and run:
su -c "yum install openmotif.i686 alsa-lib.i686"
The link keeps on changing for the ICAClient RPM, so go to download.citrix.com and do the following:
  1. Click downloads
  2. Select “Citrix Receiver” under “Select Product”
  3. Select “Receivers by platform” under “select download type”
  4. Click find
  5. Expand “Receiver for Other Platforms”
  6. Choose the Linux Receiver
  7. Choose the RPM version
Now install it:
su -c "yum localinstall ICAClient-*.rpm"
Now you should have “Citrix Receiver” under Applications -> Internet

Source : https://mknowles.com.au/wordpress/2012/12/28/installing-citrix-ica-client-on-fedora-17-64-bit/

Wednesday, 24 July 2013

Install ICAClient di Fedora

Preface

Note: I changed jobs a couple of years ago, and I no longer have access to a Citrix Server, therefore these instructions are to the best of what I had at the time, and may have changed or require tweaking since the last time I executed them.
Fortunately for us Linux users, Citrix provides binaries for connecting to Citrix servers from Linux boxen. Unfortunately, they have made the attempt to oversimplify the installation of their binaries by providing an installation script. The installation script is flawed in that it assumes you want to use Netscape as your browser. And even then it doesn’t seem to install ready-to-use. So for those of us that want to use it with a different browser (and/or Netscape for that matter), we are relegated to hunting google and/or searching for hidden documentation on how to manually install the client. So to Citrix, I say "A for effort" and "F" for not realizing that us linux techies also like to have detailed instructions on how to manually install when the automated install doesn’t suit our needs. And that brings us to the purpose of this page.

Obtaining the Citrix ICA Client

You need to obtain the Citrix ICA Client package. Citrix offers an RPM, but for the purposes of this page, I’m recommending the tarball. Thus, these instructions will be based off of the tarball download.
First, obtain the Citrix ICA Client tarball by going to http://www.citrix.com/ and selecting "Downloads". Or if you specifically want the current Linux x86 tarball, go to http://download2.citrix.com/files/de/products/client/ica/current/linuxx86.tar.gz. From this point on in the documentation, the tarball will be assumed to be the x86 version, so substitute accordingly if you have to.

Unpacking Citrix ICA Client

Once you've obtained the tarball, you need to unpack it. Pick a temporary location to unpack this tarball. For this page, we’ll use /tmp/citrix/. So create the temporary directory, move the tarball to that directory and change into that directory:
mkdir /tmp/citrix/
mv linuxx86.tar.gz /tmp/citrix/
cd /tmp/citrix/
Now unpack the tarball:
gzip –decompress linuxx86.tar.gz
tar xf linuxx86.tar
Now to run the installation command you must be logged in as the super user (root). So change to root (using su, or however).
Execute the installation script, and follow the instructions as prompted:
./setupwfc
Using the default installation directory is highly recommended. If you choose not to, you’ll have to read the install.txt to figure out what environment variables need to be set to get the Citrix ICA Client to work. The rest of this page will assume that the Citrix ICA Client was installed to its default directory. If the default was chosen, the binaries are now installed in /usr/lib/ICAClient/.

Note: I reccomend answering "No" to the installer when it asks if you'd like to integrate Citrix automatically since this How-To handles all of the setup needed.

Configuring Your Browser

These directions should work for Firefox, Mozilla, Netscape, and any other Linux Mozilla-based browser. The first step is to find the plugins directory for the browser you wish to configure. The plugins directory is typically found as a subdirectory of the installation directory for your browser. If you are unsure of the location of your plugins directory, you can try the following command to attempt to locate the plugins directory:
find / -name plugins | grep -i "netscape\|firefox\|mozilla"
We’ll assume that we are configuring Firefox, and that Firefox was installed to /opt/firefox. Again the following will have to be done as the superuser (root). Change into the plugins directory of your browser:
cd /opt/firefox/plugins/
Next, create a symlink (aka softlink) to the Citrix ICA Client library:
ln –s /usr/lib/ICAClient/npica.so npica.so
If the Citrix install script was able to find Netscape, it probably already did this step for you.

Connecting to Citrix and Using the Citrix ICA Client

Close all running instances of the browser you configured (just to be safe). Open a new instance of the browser. Type the URL of and connect to your Citrix Server (as though installation were complete). Login to the Citrix server with your user id and password. Once logged in, you should get the mini-desktop with all of your applications. The first time you click on an application, your browser is likely going to popup a dialog box giving you the choice to open the file or save the file. Choose the option to open the file. Where it asks for the application to use on this type of file, type in the path to the wfica application:
/usr/lib/ICAClient/wfica
If given the choice, tell the browser to use this application for all future downloads of this file type.
Congratulations! You have installed and configured the Citrix ICA Client.

Source : http://www.agaveblue.org/howtos/Citrix_ICA_How-To.shtml