Before everyone jumps on me for not searching, I did. Unfortunately the search kept ignoring "log" and "poller" because they are too common. So here it goes, I was wondering if there is a plugin or if there is already a log in a flat file of the polling results per host? Specifically, I am looking for the ping/round trip time for poll for each host individually. In other words if I have two hosts and I poll every five minutes, I want to see an entry for each host for each poll with the time and if it failed or not. I have to build some reports and this is something that is required. If I am confusing, I apologize. Thank you for any help. In the mean time, I will continue trying to look through the forums and maybe even modified the poller myself to create a new database entry.
Thank you again.
Poller / Polling Log
Moderators: Developers, Moderators
-
- Posts: 2
- Joined: Mon Aug 30, 2010 6:42 pm
- Location: Phoenix, AZ
-
- Posts: 2
- Joined: Mon Aug 30, 2010 6:42 pm
- Location: Phoenix, AZ
Re: Poller / Polling Log
Alright, well I went ahead and modified Cacti myself. For those of you interested, here is what I did:
1. Create new table for log entries
CREATE TABLE IF NOT EXISTS `host_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`host` int(11) NOT NULL,
`time` datetime NOT NULL,
`status` tinyint(2) NOT NULL,
`roundtrip` decimal(10,5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
2. Create database queries in lib/functions.php
Around line: 730
/* Custom Log Entry : Failed */
db_execute("insert into host_log set host='".$host_id."', time=now(), status='2', roundtrip='".$hosts[$host_id]["cur_time"]."'");
Around line: 825
/* Custom Log Entry : Successful */
db_execute("insert into host_log set host='".$host_id."', time=now(), status='1', roundtrip='".$hosts[$host_id]["cur_time"]."'");
I am using this information and other information that Cacti us already collecting and writing my own reporting system entirely separate from Cacti itself. It has it's own core code and framework but ties into the Cacti database.
Enjoy!
1. Create new table for log entries
CREATE TABLE IF NOT EXISTS `host_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`host` int(11) NOT NULL,
`time` datetime NOT NULL,
`status` tinyint(2) NOT NULL,
`roundtrip` decimal(10,5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
2. Create database queries in lib/functions.php
Around line: 730
/* Custom Log Entry : Failed */
db_execute("insert into host_log set host='".$host_id."', time=now(), status='2', roundtrip='".$hosts[$host_id]["cur_time"]."'");
Around line: 825
/* Custom Log Entry : Successful */
db_execute("insert into host_log set host='".$host_id."', time=now(), status='1', roundtrip='".$hosts[$host_id]["cur_time"]."'");
I am using this information and other information that Cacti us already collecting and writing my own reporting system entirely separate from Cacti itself. It has it's own core code and framework but ties into the Cacti database.
Enjoy!
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Poller / Polling Log
The official way to implement new features is not to patch the code but to write a plugin.
R.
R.
Who is online
Users browsing this forum: No registered users and 0 guests