Thursday, August 20, 2026

MRTG (Multi Router Traffic Grapher) on Redhat Linux 8.10

Step 1: Enable Repositories and Install Dependencies 

# Enable the EPEL repository
[root@node1 ~]#  dnf install -y https://fedoraproject.org

# Enable the CodeReady Builder repository (needed for EPEL dependencies)
[root@node1 ~]#  subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms

# Update the dnf cache
[root@node1 ~]#  dnf makecache

# Install MRTG, SNMP tools, and Apache Web Server
[root@node1 ~]#  dnf install -y mrtg net-snmp net-snmp-utils httpd

Step 2: Configure and Start SNMP

#Open the SNMP configuration file

[root@node1 ~]# vi /etc/snmp/snmpd.conf

#Map a community name (e.g., public) to a security name. Find or add the line

[root@node1 ~]# rocommunity public 127.0.0.1

#Start and enable the SNMP daemon:

[root@node1 ~]# systemctl enable --now snmpd

Test that SNMP is responding locally:

[root@node1 ~]# snmpwalk -v 2c -c public 127.0.0.1 system

Step 3: Configure Apache Web Server 

Create a web directory to host the HTML and PNG image files that MRTG generates.

# Create the directory for MRTG web files
[root@node1 ~]# mkdir -p /var/www/html/mrtg

# Give ownership to the Apache user
[root@node1 ~]# chown -R apache:apache /var/www/html/mrtg

# Start and enable Apache
[root@node1 ~]# systemctl enable --now httpd

Step 4: Generate the MRTG Configuration File

# Generate the config file
[root@node1 ~]# cfgmaker --global "WorkDir: /var/www/html/mrtg" \
             --global "Options[_]: growright,bits" \
             --output=/etc/mrtg/mrtg.cfg \
             public@127.0.0.1

Step 5: Generate the Web Index Page

Use indexmaker to scan your newly created mrtg.cfg and generate a central web index page:

[root@node1 ~]# indexmaker --output=/var/www/html/mrtg/index.html /etc/mrtg/mrtg.cfg

Step 6: Test Run MRTG

(Note: It is normal to see warnings about missing log files during the first two runs, as it has to build them from scratch.)

[root@node1 ~]#env LANG=C mrtg /etc/mrtg/mrtg.cfg

Run the command a second and third time until the error messages disappear.
Step 7: Automate Data Collection via Cron
MRTG needs to sample network metrics consistently (usually every 5 minutes). Create a cron job to handle this automatically: 
#Open the root crontab 
[root@node1 ~]# sudo crontab -e
#Add the following entry to execute MRTG every 5 minutes
*/5 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg >/dev/null 2>&1
Step 8: Adjust Firewall and SELinux (If applicable)
Allow external traffic through your firewall so you can access the web page:
# Allow HTTP traffic
[root@node1 ~]#firewall-cmd --permanent --add-service=http
[root@node1 ~]#s firewall-cmd --reload
now view your traffic charts by navigating a browser to http://<your-server-ip>/mrtg/
http://192.168.184.131/mrtg/
 


 


 
 

 
 



Tuesday, August 18, 2026

Nagios XI in Redhat Linux 8.10

[root@node1 ~]# rpm -Uvh https://repo.nagios.com/nagios/8/nagios-repo-8-2.el8.noarch.rpm

[root@node1 ~]#yum update

[root@node1 ~]# yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

[root@node1 ~]#subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms
 
[root@node1 ~]# dnf install -y  nagiosxi
The next step is the web setup.
  • Open a browser and go to:
    http://your-server-ip/nagiosxi
  • 192.168.184.131 
  • The Nagios XI setup wizard will start.
 
Click Access Nagios XI
 
 
 
 
 
 
 
 
 
 
 
 
 

 
 




Loki in Grafana

Tuesday, August 11, 2026

Terraform

https://developer.hashicorp.com/terraform/tutorials/aws-get-started/infrastructure-as-code

 

Click  Amazon Web Services à Create Infrastructure àShow Terminal àLunch and Start

 

==Installation=====

Click Install Terraform à Linux à CentOS/RHEL

 

root@staging ~]# sudo yum install -y yum-utils

[root@staging ~]# sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

[root@staging ~]# sudo yum -y install terraform

 

[root@staging ~]# terraform –version 

 

[root@staging ~]# mkdir first

[root@staging ~]# cd first

[root@staging first]# vi main.tf

 

 

 

 

 

 

Note:

 

Change region west to east 

access_key                  = "test"
secret_key                  = "test"
 

[root@staging first]# terraform init

 

 [root@staging ~]# terraform plan

 

 

 

 

http://192.168.184.132:4500/cloud-explorer/aws/storage

 

 

 

 

 

 

For reference

 

 

Terraform Providers

https://registry.terraform.io/browse/providers

 

https://registry.terraform.io/providers/hashicorp/aws/latest/docs

 

 

 

resource "aws_instance" "example" {

  ami           = "resolve:ssm:/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-x86_64"

  instance_type = "t3.micro"

 

  tags = {

    Name = "HelloWorld"

  }

}

 

Floci AMI id

https://floci.io/floci/services/ec2/

[root@staging ~]# vi mail.tf

resource "aws_instance" "example" {

  ami           = "ami-0abcdef1234567890"

  instance_type = "t3.micro"

 

  tags = {

    Name = "HelloWorld"

  }

}