简体   繁体   English

PHP脚本更新rrd数据库

[英]PHP script to update rrd database

I must developing an network monitor to monitoring several components using snmp. 我必须开发一个网络监视器以使用snmp监视多个组件。 I save all received data in a round robin database. 我将所有收到的数据保存在循环数据库中。

I started to create an web based configuration center, that allows users to add devices to be monitored and access all the graphs (using rrdtool) of all devices. 我开始创建一个基于Web的配置中心,该中心允许用户添加要监视的设备并访问所有设备的所有图形(使用rrdtool)。

I must run an daily, week, month and yearly update of the database. 我必须每天,每周,每月和每年对数据库进行更新。

My question is, how can i launch an script that executes an snmp command to fetch the data from the device and stores it on the databse and runs on background ? 我的问题是,我如何启动执行snmp命令的脚本以从设备获取数据并将其存储在数据库中并在后台运行? By background, i mean that it is a process that not depends if the user has logged in in the web configuration page or not. 在后台,我的意思是这是一个不依赖于用户是否已登录Web配置页面的过程。

I never did something in PHP, therefore i am asking you. 我从未在PHP中做过任何事情,因此我问你。

I hope you can help me out. 我希望你能帮助我。 Thank you in advance. 先感谢您。 Best regard. 最良好的问候。

I have developed such a system a few years ago. 几年前,我开发了这样的系统。 We used Cacti , in combination with Nagios and Smokeping . 我们将仙人掌NagiosSmokeping结合使用。 Of course, if your needs are simpler, you could use cron scripts to fetch your data. 当然,如果您的需求更简单,则可以使用cron脚本来获取数据。 But Cacti is definetely worth a look (as well as Nagios, but unlike Cacti, it's not specifically targetted at RRD files) 但是Cacti非常值得一看(与Nagios一样,但与Cacti不同,它并非专门针对RRD文件)

Note that none of these systems require PHP. 请注意,这些系统都不要求PHP。 They run standalone, as daemons. 它们作为守护程序独立运行。 It's then pretty straightforward to write a web interface on top of that. 在此之上编写一个Web界面非常简单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM