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

Network server monitoring

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

1. Monitoring introduction:

He is a means of passing data to the monitoring platform through an agent.

2. Monitoring method 1 (SNMP+RRDTool+CACTI):

SNMP (simple network management protocol): simple Network Management Protocol

RRDtool: a drawing tool in which the collected data is processed and drawn into some kind of graph.

Cacti (php): display graphical data

1. There are three versions of snmp, which are snmp v1, SNMP v2, snmpv3.

Snmp v1: it is based on communitils. The name of communty is the password authenticated by both parties.

There are three types of communities: read-only (read-only), read-write (read-write, can send instructions), trap (the monitored end can actively send requests to the monitoring end); trap itself is only a mechanism for the monitored end to send requests to the monitoring end, but there are only two mechanisms for the monitoring side to operate: one is read-only and the other is read-write.

The working mechanism of snmp v1: a monitoring side (nms) and a monitored side (agent) are required. Nms sends an instruction to agent to obtain the client's data. The agent receives the instruction to query the corresponding information and sends it to the monitoring side (nms). In order to achieve the security of the data, it is authenticated by community. (the problem is that security is not high)

Snmp v2 is also implemented based on communitils-string. Feature enhancements have been made in the v1 version.

Snmp v3 enhances the authentication mechanism

But snmp v1 is the most popular at present.

MIB (manmagement information base): management information base. He is a pre-defined monitoring repository of agent request data.

So each snmp agent has a mib library to define the data.

The mib-II is as follows:

MIB marking of host monitoring data: (host OID)

Monitoring can be done: fault management, configuration management, accounting management, performance management, security management

Snmp notification mechanism: implemented through snmp port: udp 161( agent), udp162 (nms)

Snmp default groups: public community, private community

Snmp message classification:

Get: gets specific OID (object identifier) information.

Getnext: gets the OID information of all direct metrics under the specified node. (it can only obtain direct metric data under the node)

Getbulk (snmp v2 & snmp v3): gets the metric data of all nodes under the specified node. Has a wider range than getnext.

Set: send control instructions

Getresponse: initiates the response message.

Trap: initiated by the trap side.

Enable snmp on linux:

There are two snmp packages on linux: net-snmp and net-snmp-utils

Net-snmp: monitored side (agent) (this package needs to be installed if you need to use the trap feature)

Net-snmp-utils (commands required by the monitor)

Installation steps:

[root@promote yum.repos.d] # yum install net-snmp.x86_64 net-snmp-utils.x86_64 / / install snmp package

[root@promote yum.repos.d] # rpm-ql net-snmp | less / / check what tools have been generated after installing the snmp software package

/ etc/snmp

/ etc/snmp/snmpd.conf

/ etc/snmp/snmptrapd.conf

/ etc/sysconfig/snmpd

/ etc/sysconfig/snmptrapd

[root@promote yum.repos.d] # systemctl start snmpd / / start the snmp service

[root@promote yum.repos.d] # netstat-unlp / / check whether to start the snmp service

[root@promote yum.repos.d] # snmpwalk-v 2c-c public localhost / / View host information through snmp

[root@promote mibs] # cat / etc/snmp/snmpd.conf / / View snmp configuration file information

2. RRDtool (Round Robin Database tool): a drawing tool in which the collected data is processed and drawn into some kind of graph.

3. Cacti (php): display the graphic data

Its function is:

Automatically create rrdtool statements, that is, rrdtool create

Periodically execute commands that can obtain data, and save the retrieved data to the rrd file.

Use rrdtool to draw and show

Cacti is a web program developed by php.

Therefore, LAMP, LNMP must be installed, and if the installation is compiled,-- enable-sockets must be enabled.

Cacti also supports plug-in mechanisms such as the thold plug-in (alarm mechanism).

Cacti also supports three template mechanisms: graphic template, data template and host template.

Graphic templates: define how graphics are drawn

Data template: defines how the data is obtained, how it is saved, and where it is saved

Mainframe template: classified graphic template and data template.

How does cacti get the data:

Script

Snmp

Ssh (key-based authentication)

How cacti saves data:

Data template (defines how to get data saved from other hosts)

How cacti presents the data:

Graphic template

Install cacti:

A. Install the LAMP environment

[root@promote ~] # yum-y install httpd mysql mysql-server php php-mysql php-devel.x86_64

B. Edit the httpd configuration file and modify the home page location (you can also default)

C. Install cacti (the plug-in framework after cacti-0.8.8 is integrated by default.

4. Create a mysql database to store cacti data: # mysqladmin create cactidb

5. Import the cacti.sql under cacti into the database # mysqlcactidb < cacti.sql

6. Create a mysql account: # mysql-e "GRANT ALL ON cactidb.*TO cactiuser@localhost IDENTIFIED BY 'cactiuser'

3: monitoring method 2 (nagios):

Nagios: monitoring the status of data

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

Servers

Wechat

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

12
Report