Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Practical Cacti Network Monitoring (2)-- Building Spine lightweight Framework to realize Multi-thread Monitoring

2025-03-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

This experiment follows the environment of the last experiment. Practical Cacti Network Monitoring (1)-- basic installation configuration

Content of the experiment:

1. Monitor physical hosts

2.Spine multithread monitoring

3.monitor monitoring plug-in

1. Monitor physical hosts

The configuration on the physical host is as follows:

Yum install net-snmp.x86_64-y # # install the snmp service

Yum install net-snmp-utils.x86_64-y

Vim / etc/snmp/snmpd.conf

41 # com2sec notConfigUser default public

42 com2sec local localhost public

43 com2sec mynetwork 172.25.254.0/24 public

forty-four

45 #

46 # Second, map the security name into a group name:

forty-seven

48 # groupName securityModel securityName

49 # group notConfigGroup v1 notConfigUser

50 # group notConfigGroup v2c notConfigUser

51 group MyRWGroup v1 local

52 group MyRWGroup v2c local

53 group MyRWGroup usm local

54 group MyROGroup v1 mynetwork

55 group MyROGroup v2c mynetwork

56 group MyROGroup usm mynetwork

57 #

58 # Third, create a view for us to let the group have rights to:

fifty-nine

60 # Make at least snmpwalk-v 1 localhost-c public system fast again.

61 # name incl/excl subtree mask (optional)

62 view systemview included .1.3.6.1.2.1

63 view systemview included .1.3.6.1.2.1.25.1.1

64 view all included. 1 80

65 #

69 # access notConfigGroup "" any noauth exact systemview none none

70 access MyROGroup "" any noauth exact all none none

71 access MyRWGroup "" any noauth exact all all none

72 #--

170 syslocation RHEL6.5

171 syscontact Root

331 disk / 10000

Systemctl start snmpd

Snmpwalk-v 1-c public localhost IP-MIB::ipAdEntIfIndex # #-v refers to the version, and-c refers to the key, which is set in the client snmp.conf. The recognized key group is public (this is also one of the well-known bug of snmp, which is not secure! Of course, you can also change your own password. IP--MIB means to obtain the IP information of the system (physical machine).

*

[root@willis Desktop] # snmpwalk-v 1-c public localhost IP-MIB::ipAdEntIfIndex

IP-MIB::ipAdEntIfIndex.10.52.115.4 = INTEGER: 24

IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1

IP-MIB::ipAdEntIfIndex.172.25.254.6 = INTEGER: 22

IP-MIB::ipAdEntIfIndex.192.168.122.1 = INTEGER: 5 *

Snmpwalk-v 1 localhost-c public. 1.3.6.1.4.1.2021.9

*

[root@foundation38 snmp] # snmpwalk-v 1 localhost-c public .1.3.6.1.4.1.2021.9 # # View system information management block

UCD-SNMP-MIB::dskIndex.1 = INTEGER: 1

UCD-SNMP-MIB::dskPath.1 = STRING: /

UCD-SNMP-MIB::dskDevice.1 = STRING: / dev/mapper/rhel-root

UCD-SNMP-MIB::dskMinimum.1 = INTEGER: 10000

UCD-SNMP-MIB::dskMinPercent.1 = INTEGER:-1

UCD-SNMP-MIB::dskTotal.1 = INTEGER: 225661280

UCD-SNMP-MIB::dskAvail.1 = INTEGER: 102136208

UCD-SNMP-MIB::dskUsed.1 = INTEGER: 123525072

UCD-SNMP-MIB::dskPercent.1 = INTEGER: 55

UCD-SNMP-MIB::dskPercentNode.1 = INTEGER: 0

UCD-SNMP-MIB::dskTotalLow.1 = Gauge32: 225661280

UCD-SNMP-MIB::dskTotalHigh.1 = Gauge32: 0

UCD-SNMP-MIB::dskAvailLow.1 = Gauge32: 102136208

UCD-SNMP-MIB::dskAvailHigh.1 = Gauge32: 0

UCD-SNMP-MIB::dskUsedLow.1 = Gauge32: 123525072

UCD-SNMP-MIB::dskUsedHigh.1 = Gauge32: 0

UCD-SNMP-MIB::dskErrorFlag.1 = INTEGER: noError (0)

UCD-SNMP-MIB::dskErrorMsg.1 = STRING:

*

Web-side configuration

Open a web page http:172.25.254.10

Select Device on the left and click Add

This is created.

Then click the first one on the top right

Add a virtual machine monitoring interface

Console-> Graph Trees-> (Edit)-> Graph Tree Items

2.Spine multithread monitoring

Compile cacti-spine on the virtual host server6:

Tar zxf cacti-spine-0.8.8h.tar.gz

Cd cacti-spine-0.8.8h

"1" yum install net-snmp-devel mysql-devel openssl-devel-y # # solves dependencies

"2" yum install dos2unix autoconf automake binutils libtool gcc cpp glibc-headers glibc-devel-y

"3" sh bootstrap

"4" / configure

"5" make & & make install

Cd / usr/local/spine/etc

"1" cp spine.conf.dist / etc/spine.conf

"2" vim / etc/spine.conf # # make the following modifications

33 DB_Host localhost

34 DB_Database cacti

35 DB_User cacti

36 DB_Pass redhat

37 DB_Port 3306

Su-cacti

"1" / usr/local/spine/bin/spine

*

[root@server10 etc] # su-cacti

-bash-4.1 $/ usr/local/spine/bin/spine

SPINE: Using spine config file [/ etc/spine.conf]

SPINE: Version 0.8.8h starting

SPINE: Time: 0.0821 s, Threads: 5, Hosts: 3

-bash-4.1 $

*

Web page addition

Console-> Cacti Settings

The path to Spine binary. / usr/local/spine/bin/spine

*

Vim / etc/php.ini # # modify the time zone of PHP

946 date.timezone = Asia/Shanghai

/ etc/init.d/httpd restart # # restart the apache service

Cd / var/www/html/cacti/log

Tail-f / var/www/html/cacti/log/cacti.log # # monitor the log, or use cat cacti.log, as long as a message similar to the following appears:

*

03:20:01 PM-SYSTEM STATS: Time:0.1069 Method:cmd.php Processes:1 Threads:N/A Hosts:3 HostsPerProcess:3 DataSources:18 RRDsProcessed:16 * **************

3.monitor monitoring plug-in

(1) tar-zxf monitor-v1.3-1.tgz-C / var/www/html/cacti/plugins

(2) browser page operation:

The construction has been completed, and the change curve of server performance can be clearly seen after a period of time.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report