Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon May 29, 2017 5:50 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: device_remove hook, working but then blank screeb
PostPosted: Mon Jan 30, 2017 5:08 am 
Offline
Cacti User

Joined: Wed Dec 07, 2011 9:19 am
Posts: 185
Hello,
I setup the device_remove hook, to be able to clean up my table when a device is removed!
It's executed, but then it got me a blank screen, nothing on cacti.log file, but this on the apache error log:
[Mon Jan 30 11:05:14.955649 2017] [:error] [pid 31020] [client 10.85.116.130:53200] PHP Warning: Cannot modify header information - headers already sent in /usr/share/cacti/host.php on line 311, referer: http://lslcact01.lausanne.ch/cacti/host.php


and this is my hook:
function linkdiscovery_device_remove( $hosts_id ){
//array(1) { [0]=> string(4) "1921" } device remove :
foreach( $hosts_id as $host_id) {
// remove host from plugin_linkdiscovery_hosts and plugin_linkdiscovery_intf
db_execute("DELETE FROM plugin_linkdiscovery_hosts where id=".$host_id );
db_execute("DELETE FROM plugin_linkdiscovery_intf where host_id_dst=".$host_id );
db_execute("DELETE FROM plugin_linkdiscovery_intf where host_id_src=".$host_id );
}

return;
}


any clue what is wrong ?
thanks

_________________
CentOS
Cacti 0.8.8h
Spine 0.8.8h
PIA 3.1
Aggregate 0.75
Monitor 1.3
Settings 0.71
Weathermap 0.98
Thold 0.5
rrdclean 0.41

Own plugin: LinkDiscovery 0.3


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group