CN104991849A - Method for monitoring system resources occupied by Linux process through zabbix - Google Patents

Method for monitoring system resources occupied by Linux process through zabbix Download PDF

Info

Publication number
CN104991849A
CN104991849A CN201510370502.8A CN201510370502A CN104991849A CN 104991849 A CN104991849 A CN 104991849A CN 201510370502 A CN201510370502 A CN 201510370502A CN 104991849 A CN104991849 A CN 104991849A
Authority
CN
China
Prior art keywords
zabbix
data
cpu
name
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510370502.8A
Other languages
Chinese (zh)
Inventor
周庆勇
付迅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Software Co Ltd
Original Assignee
Inspur Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Software Co Ltd filed Critical Inspur Software Co Ltd
Priority to CN201510370502.8A priority Critical patent/CN104991849A/en
Publication of CN104991849A publication Critical patent/CN104991849A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method for monitoring system resources occupied by a Linux process through zabbix. The specific realization process of the method is as follows: a to-be-monitored server is found in the zabbix system, and a new monitoring item is created; after the zabbix system is started, parameters are transmitted to a data acquisition function according to the monitoring item, and the function is executed; the data acquisition function executes a corresponding command according to the obtained parameters, and obtains and outputs a result; the zabbix system obtains the result output by the data acquisition function and writes the result into a database; and data is viewed through a web program. Compared to the prior art, the method for monitoring the system resources occupied by the Linux process through the zabbix system has the characteristics of reasonable conception, convenience in use, manpower saving, high intelligence and the like, and is high in practicality, wide in application range and easy to popularize.

Description

A kind of method being monitored Linux process occupying system resources by zabbix
Technical field
The present invention relates to field of computer technology, specifically a kind of practical, method of being monitored Linux process occupying system resources by zabbix.
Background technology
Along with the sustainable development of information age, IT O&M has become ingredient important in IT service connotation.In the face of the business that becomes increasingly complex, in the face of more and more diversified user's request, the IT application of constantly expansion need more and more reasonably pattern ensure IT service can flexibly convenient, continue guarantee with security and stability, the security factors in this pattern is exactly IT O&M.Huge data center is developed into from several station servers at initial stage, depend merely on the requirement that manually cannot meet in technology, business, management etc., the factor that so standardization, robotization, framework optimization, process optimization etc. reduce IT cost of serving is more and more valued by the people.Server often runs much important process, the monitoring these processes being taken to CPU and memory size can allow managerial personnel grasp their operation conditions.Zabbix is the solution of increasing income providing the enterprise-level of distributed system supervision and network monitoring function at a sing on web interface.Based on this, a kind of method monitoring Linux process occupying system resources by zabbix is now provided, the present invention is based on zabbix and expand.Web system due to zabbix has a lot of drawback, so adopt Spring, iBatis, JSP, Highcharts to develop a set of new web system.
Summary of the invention
Technical assignment of the present invention is for above weak point, provides a kind of practical, method of being monitored Linux process occupying system resources by zabbix.
Monitored a method for Linux process occupying system resources by zabbix, its specific implementation process is:
In zabbix system, find the server that will monitor, create a new monitored item;
Parameter is passed to data acquisition function according to monitored item, and is performed after starting by zabbix;
Data acquisition function performs corresponding order according to the parameter obtained, and obtains and Output rusults;
Zabbix obtains the result write into Databasce that data acquisition function exports;
Data are checked by web program.
Described data acquisition function is that internal storage data obtains function or cpu data obtains function, and wherein internal storage data obtains function for collecting proceeding internal memory data; Cpu data obtains function for collecting process cpu data.
The type of described monitored item is that passive type Zabbix acts on behalf of, data type is floating type, key assignments is process.cpu [process name] or process.memory [process name], i.e. monitoring process CPU usage under one's name or monitoring process memory usage under one's name.
After " process name " is passed to data acquisition function above by Zabbix system, meeting obtain internal memory according to process name and top order and CPU takies data, finally result is returned to zabbix, then writes the database of zabbix.
The monitoring output procedure of described CPU usage is: the key assignments of monitored item is process.memory [process name], parameter " process name " can be passed to cpu data and obtain function by zabbix, the top order of this function obtains the CPU usage under " process name ", because there are several processes under " process name ", end product is obtained so the CPU usage of all processes of being somebody's turn to do under " process name " be added, then by echo order Output rusults.
The monitoring output procedure of described memory usage is: the key assignments of monitored item is process.memory [process name], parameter " process name " can be passed to internal storage data and obtain function by zabbix, the top order of this function obtains the memory usage under " process name ", because there are several processes under " process name ", end product is obtained so the memory usage of all processes of being somebody's turn to do under " process name " be added, then by echo order Output rusults.
A kind of method monitoring Linux process occupying system resources by zabbix of the present invention, has the following advantages:
A kind of method monitoring Linux process occupying system resources by zabbix of this invention is that the monitoring that in cluster, some important process of certain station server takies CPU and internal memory situation provides solution, any process on any server of can monitoring in real time in cluster takies the situation of CPU and internal memory, and show in real time on Web interface, produce warning information reminding user when taking resource and exceeding and specify size; The present invention has reasonable idea, easy to use, saving manpower, intelligence degree high, practical, applied widely, is easy to promote.
Accompanying drawing explanation
Accompanying drawing 1 is monitoring process flow diagram of the present invention.
Accompanying drawing 2 is the real-time monitoring data figure in Web interface display.
Embodiment
Below in conjunction with the drawings and specific embodiments, the invention will be further described.
The invention provides a kind of method being monitored Linux process occupying system resources by zabbix, the present invention can monitor CPU usage and the memory usage of in cluster, any Linux server being specified process in real time, and show in real time on Web interface, produce warning information reminding user when occupancy exceeds and specifies size.
Parameter is passed to internal storage data and is obtained function or cpu data obtains function by the present invention by create key assignments be process.cpu [process name] with the monitored item of process.memory [process name], pass to zabbix and write into Databasce after this function acquisition data.
Key assignments is the monitored item of process.cpu [process name] and process.memory [process name], and wherein " process name " is parameter.
The internal storage data that the cpu data obtaining process CPU usage according to key assignments and parameter " process name " obtains function and EMS memory occupation size obtains function.
Based on this mentality of designing, as shown in Figure 1, the implementation procedure of the method is:
In zabbix system, find the server that will monitor, create a new monitored item;
Parameter is passed to data acquisition function according to monitored item, and is performed after starting by zabbix;
Data acquisition function performs corresponding order according to the parameter obtained, and obtains and Output rusults;
Zabbix obtains the result write into Databasce that data acquisition function exports;
Data are checked by web program.
Described data acquisition function is that internal storage data obtains function or cpu data obtains function, and wherein internal storage data obtains function for collecting proceeding internal memory data; Cpu data obtains function for collecting process cpu data.
The type of described monitored item is that passive type Zabbix acts on behalf of, data type is floating type, key assignments is process.cpu [process name] or process.memory [process name], i.e. monitoring process CPU usage under one's name or monitoring process memory usage under one's name.
After " process name " is passed to data acquisition function above by Zabbix system, meeting obtain internal memory according to process name and top order and CPU takies data, finally result is returned to zabbix, then writes the database of zabbix.
The monitoring output procedure of described CPU usage is: the key assignments of monitored item is process.memory [process name], parameter " process name " can be passed to cpu data and obtain function by zabbix, the top order of this function obtains the CPU usage under " process name ", because there are several processes under " process name ", end product is obtained so the CPU usage of all processes of being somebody's turn to do under " process name " be added, then by echo order Output rusults.
The monitoring output procedure of described memory usage is: the key assignments of monitored item is process.memory [process name], parameter " process name " can be passed to internal storage data and obtain function by zabbix, the top order of this function obtains the memory usage under " process name ", because there are several processes under " process name ", end product is obtained so the memory usage of all processes of being somebody's turn to do under " process name " be added, again by echo order Output rusults, only in this way export zabbix and could obtain result.
Specific embodiment:
The server that will monitor is found in zabbix system, create a new monitored item item, key assignments key is process.cpu [process name] or process.memory [process name], be specially: process.cpu [zabbix_server], the i.e. CPU usage of monitoring process zabbix_server, process.memory [zabbix_server], the i.e. memory usage of monitoring process zabbix_server.
Amendment zabbix_agentd.conf configuration file, adds following configuration information:
UserParameter=process.cpu[*],/usr/local/zabbix/plugins/process_cpu.sh $1;
UserParameter=process.memory[*],/usr/local/zabbix/plugins/process_mem.sh $1。
Wherein process.cpu [*] and process.memory [*] are the key assignments of the monitored item newly created, process _ cpu.sh is the shell script of collection process cpu data, process_memory.sh is the shell script collecting proceeding internal memory data, and $ 1 is the parameter in key assignments---process name.
It is as follows that internal storage data obtains function code:
name=$1;
data_=(`top -b -n 1 | grep $name|awk '{print $10}'`);
length=${#data_[@]};
value_=0;
for((j=0;j<$length;j++));
do;
value_=`echo ${data_[j]}+$value_|bc`;
done;
echo $value_。
It is as follows that cpu data obtains function code:
name=$1;
data_=(`top -b -n 1 | grep $name|awk '{print $9}'`);
length=${#data_[@]};
value_=0;
for((j=0;j<$length;j++));
do;
value_=`echo ${data_[j]}+$value_|bc`;
done;
cores=`cat /proc/cpuinfo| grep "processor"| wc -l`;
The cpu utilization factor that value_=`echo $ value_/$ cores|bc` #top order obtains needs the check figure divided by cpu;
echo $value_。
After $ 1 is passed to data acquisition function above by Zabbix system, meeting obtain internal memory according to process name ($ 1) and top order and CPU takies data, finally result is returned to zabbix, then writes the database of zabbix.
Complete above configuration and just can see real-time monitoring data at Web interface afterwards, as shown in Figure 2, dark for taking the monitor data figure of CPU, light color is the monitor data figure of committed memory to concrete outcome.
Above-mentioned embodiment is only concrete case of the present invention; scope of patent protection of the present invention includes but not limited to above-mentioned embodiment; any according to the invention a kind of monitored claims of the method for Linux process occupying system resources by zabbix and any person of an ordinary skill in the technical field to its suitable change done or replacement, all should fall into scope of patent protection of the present invention.

Claims (6)

1. monitored a method for Linux process occupying system resources by zabbix, it is characterized in that, its specific implementation process is:
In zabbix system, find the server that will monitor, create a new monitored item;
Parameter is passed to data acquisition function according to monitored item, and is performed after starting by zabbix;
Data acquisition function performs corresponding order according to the parameter obtained, and obtains and Output rusults;
Zabbix obtains the result write into Databasce that data acquisition function exports;
Data are checked by web program.
2. a kind of method being monitored Linux process occupying system resources by zabbix according to claim 1, it is characterized in that, described data acquisition function is that internal storage data obtains function or cpu data obtains function, and wherein internal storage data obtains function for collecting proceeding internal memory data; Cpu data obtains function for collecting process cpu data.
3. a kind of method being monitored Linux process occupying system resources by zabbix according to claim 1 and 2, it is characterized in that, the type of described monitored item is that passive type Zabbix acts on behalf of, data type is floating type, key assignments is process.cpu [process name] or process.memory [process name], i.e. monitoring process CPU usage under one's name or monitoring process memory usage under one's name.
4. a kind of method being monitored Linux process occupying system resources by zabbix according to claim 3, it is characterized in that, after " process name " is passed to data acquisition function above by Zabbix system, meeting obtain internal memory according to process name and top order and CPU takies data, finally result is returned to zabbix, then write the database of zabbix.
5. a kind of method being monitored Linux process occupying system resources by zabbix according to claim 4, it is characterized in that, the monitoring output procedure of described CPU usage is: the key assignments of monitored item is process.memory [process name], parameter " process name " can be passed to cpu data and obtain function by zabbix, the top order of this function obtains the CPU usage under " process name ", because there are several processes under " process name ", end product is obtained so the CPU usage of all processes of being somebody's turn to do under " process name " be added, again by echo order Output rusults.
6. a kind of method being monitored Linux process occupying system resources by zabbix according to claim 4, it is characterized in that, the monitoring output procedure of described memory usage is: the key assignments of monitored item is process.memory [process name], parameter " process name " can be passed to internal storage data and obtain function by zabbix, the top order of this function obtains the memory usage under " process name ", because there are several processes under " process name ", end product is obtained so the memory usage of all processes of being somebody's turn to do under " process name " be added, again by echo order Output rusults.
CN201510370502.8A 2015-06-30 2015-06-30 Method for monitoring system resources occupied by Linux process through zabbix Pending CN104991849A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510370502.8A CN104991849A (en) 2015-06-30 2015-06-30 Method for monitoring system resources occupied by Linux process through zabbix

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510370502.8A CN104991849A (en) 2015-06-30 2015-06-30 Method for monitoring system resources occupied by Linux process through zabbix

Publications (1)

Publication Number Publication Date
CN104991849A true CN104991849A (en) 2015-10-21

Family

ID=54303665

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510370502.8A Pending CN104991849A (en) 2015-06-30 2015-06-30 Method for monitoring system resources occupied by Linux process through zabbix

Country Status (1)

Country Link
CN (1) CN104991849A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105530145A (en) * 2015-12-23 2016-04-27 中国电子科技集团公司第三十研究所 Agentless equipment monitoring network based on ZABBIX framework, networking method and monitoring method
CN106383773A (en) * 2016-09-05 2017-02-08 天脉聚源(北京)传媒科技有限公司 Method and device for monitoring redis database
CN107846442A (en) * 2017-08-02 2018-03-27 上海数烨数据科技有限公司 It is a kind of to increase the method for customizing passage gathered data based on Zabbix aggressive modes
CN109992471A (en) * 2018-01-02 2019-07-09 中国移动通信有限公司研究院 A kind of method and device of internal memory monitoring

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100621596B1 (en) * 2003-04-22 2006-09-18 학교법인 영남학원 Mehod for monitoring in network system
CN102999412A (en) * 2012-11-21 2013-03-27 浪潮电子信息产业股份有限公司 Method for monitoring process under Linux
CN104457984A (en) * 2014-12-30 2015-03-25 中国科学院长春光学精密机械与物理研究所 Low-stray-light small monochrometer

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100621596B1 (en) * 2003-04-22 2006-09-18 학교법인 영남학원 Mehod for monitoring in network system
CN102999412A (en) * 2012-11-21 2013-03-27 浪潮电子信息产业股份有限公司 Method for monitoring process under Linux
CN104457984A (en) * 2014-12-30 2015-03-25 中国科学院长春光学精密机械与物理研究所 Low-stray-light small monochrometer

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
可额窦炎: "Zabbix深入分析", 《HTTPS://WENKU.BAIDU.COM/VIEW/7744DB0F783E0912A2162ADD.HTML?RE=VIEW》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105530145A (en) * 2015-12-23 2016-04-27 中国电子科技集团公司第三十研究所 Agentless equipment monitoring network based on ZABBIX framework, networking method and monitoring method
CN106383773A (en) * 2016-09-05 2017-02-08 天脉聚源(北京)传媒科技有限公司 Method and device for monitoring redis database
CN107846442A (en) * 2017-08-02 2018-03-27 上海数烨数据科技有限公司 It is a kind of to increase the method for customizing passage gathered data based on Zabbix aggressive modes
CN109992471A (en) * 2018-01-02 2019-07-09 中国移动通信有限公司研究院 A kind of method and device of internal memory monitoring

Similar Documents

Publication Publication Date Title
CN110263054A (en) Auditing system, checking method, device and the computer equipment of SQL work order
CN112687097A (en) Highway highway section level data center platform system
CN110019267A (en) A kind of metadata updates method, apparatus, system, electronic equipment and storage medium
CN104036365A (en) Method for constructing enterprise-level data service platform
CN105719126B (en) system and method for scheduling Internet big data tasks based on life cycle model
CN104991849A (en) Method for monitoring system resources occupied by Linux process through zabbix
CN108229799B (en) Multi-source heterogeneous power grid operation real-time data access system and method
CN106201754A (en) Mission bit stream analyzes method and device
CN106210124B (en) A kind of unified cloud data center monitoring system
CN108874524A (en) Big data distributed task dispatching system
CN115374102A (en) Data processing method and system
CN105430030A (en) OSG-based parallel extendable application server
CN103345386A (en) Software production method, device and operation system
CN105095496A (en) Method for monitoring MYSQL table space through ZABBIX
KR20080041911A (en) Apparatus for processing of integrated data of various sensor networks and its method
CN106341276A (en) IMA system configuration generating method based on constraint satisfaction theory
CN111917885A (en) System for managing cloud computing service
CN112613790A (en) Cooperative data processing method, device and medium applied to multi-station fusion environment
CN111984301A (en) Micro-service data management framework based on spring close and kubernets
CN116468320A (en) Intelligent energy consumption integrated management system
CN106502842A (en) Data reconstruction method and system
CN114756301B (en) Log processing method, device and system
CN109165203A (en) Large public building energy consumption data based on Hadoop framework stores analysis method
CN109240757A (en) Configuration management system and method in a kind of big data component set
CN114997574A (en) Power distribution station area elastic resource management method and device based on service middling station

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20151021