Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Wed Mar 20, 2019 6:56 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 
Cacti User

Joined: Wed Dec 07, 2011 9:19 am
Posts: 321
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] PHP Warning: Cannot modify header information - headers already sent in /usr/share/cacti/host.php on line 311, referer:

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 );


any clue what is wrong ?

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, Map 0.4

Cacti 1.2.1
Spine 1.2.1
thold 1.0.6
monitor 2.3.5
php 7.2.11
mariadb 5.5.56
Own plugin:
ExtendDB 1.1.2
LinkDiscovery 1.2.4
Map 1.2.5

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