Search This Blog

Monitor Linux and Windows

Cacti can monitor most of the network device that support SNMP. In this guide, show how to monitor Linux and Windows host on Cacti. In this scenarios we use Centos 7 and Windows 7 to monitor on Cacti.

Monitor Cent OS 7

To be able to monitor Cent OS 7 on Cacti, we need to install SNMP service.

Update our system to get the latest update.

yum update –y

Install Net-SNMP

yum -y install net-snmp net-snmp-utils

Restart service and enable to auto start when server start up.

systemctl restart snmpd
systemctl enable snmpd
Configure SNMP

Make change on snmp default configuration.

vi /etc/snmp/snmpd.conf

# line 41: comment out

#com2sec notConfigUser default public

# line 74,75: uncomment and change
# change "mynetwork" to your own network
# change comunity name to anyone except public, private (for security reason)

com2sec local localhost start-do-its
com2sec mynetwork 192.168.100.0/24 start-do-its

# line 78,79: uncomment and change

group MyRWGroup v2c local
group MyROGroup v2c mynetwork

# line 85: uncomment

view all included .1 80

# line 93,94: uncomment and change

access MyROGroup "" v2c noauth exact all none none
access MyRWGroup "" v2c noauth exact all all all

# line 323: uncomment
disk / 10000

Allow Firewalld

firewall-cmd --zone=public --add-service snmp --permanent
firewall-cmd --reload

Add Cent OS 7 to Cacti

Go to Cacti web interface under Main Console -> Create -> New Device.

Please fill in the follow field. If we don't understand what to fill in each field, we can hover mouse on the question mark ?. 
Description: give the description for this device.
Hostname: the ip address or device name but make sure our DNS is resolve properly.
Device Template: choose the right device template Net-SNMP Device for Linux host.
SNMP Version: choose the correct version based on snmp version that we install on Linux host.
SNMP Community String: specify the snmp community that match with string we configure on device to monitor.
Downed Device Detection: choose SNMP uptime. 
Then click on Create.


Create Graph

After we clicked on Create, we can see the information about this device at the top SNMP Information. To create graph, go to Create Graphs for this Device on the right side to create graph for this device.


Select device in Device that we want to create graph for it, and select the Graph Type for which type of graph we are going to create for this device. In this scenario we selected the graph type SNMP – Get Mounted Partitions, it will show all the mounted partitions on this device and check the box at the right side for which partition we want to graph and click on Create.


If we want to create graph for the Interface Traffic, we can choose the graph type SNMP - Interface Statistics and select which interface that we want to graph, choose In/Out Bits click on Create.


If we want to see all the available graphs for this device, we can choose Graph Type All then scroll down all the available graphs will be there.



Check Result

After we created all the graph for this device, we need to wait for 5 minutes, to see the result go to Management tab => Graphs and select device that want to see its all graph.  Ex: we click on Traffic – 192.168.100.130(ens33) we will see the network traffic of this interface on that device.


After we created all the graph for this device, we need to wait for 5 minutes, to see the result go to Management tab => Graphs and select device that want to see its all graph.  Ex: we click on Traffic we will see the network traffic of this interface on that device.


Ex: The graph of Physical Memory on this device.


Monitor Windows 7

Enable SNMP on Windows host


To add windows, host to the Cacti, first we need to install SNMP service on the managed device. In this post we install snmp service on Windows 7. To do that, go to Control Panel => Programs and Features => Turn Windows feature on or off and tick the box Simple Network Management Protocol (SNMP) and WMI SNMP Provider then restart.



After the computer is started, go to service by hold the Windows Key + R and type services.msc an then right click on SNMP Service => Properties.


Go to Agent tab and tick all the check box below and fill the information in Contact and Location. And click on Apply.


After that, go to the Security tab and add the SNMP community string, check the Accept the SNMP packet from any host. Click on OK.


Add Windows host to Cacti

We can follow the previous step to add new device or we can do the other method by going to Management => Devices =>plus sign (+).


It is not different from the previous step but just this time we choose the Device Template Windows Device.


Create Graph

Go to Create graph for this Device to make graph for this device.


We do almost the same in this example we want to graph only the Interface of this device. Choose the device name in Device => Graph Type => Interface => In/Out Bits => Create.


Check Result

Wait for 5 minutes, and do the same step as previous to see the graph


Here is the network traffic on the network card of windows 7.


Conclusion
I hope you all be able to understand this post well. If you don't understand any point or  have any problem, recommendation, suggestion don't hesitate to tell us, we will try our best to help. You may also like Related Posted:

READ: How to install Cacti specific version on Centos 7
READHow to install Cacti on Centos 7

No comments:

Post a Comment

How to install zabbix Server on Rocky Linux 9

How to set up Zabbix Server on Rocky Linux 9 1. Set Selinux to permissive mode sudo setenforce 0 sudo sed -i...