Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Sat Oct 25, 2014 3:36 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: R42 : Script - Script Server (PHP) seems to not work anymore
PostPosted: Sat Aug 28, 2004 3:39 pm 
R42 : Script - Script Server (PHP) seems to not work anymore
======================================================

Release : cacti-0.8.6-pre20040828 (2 download - 16:00)



Previously with "Script Command" it was working
c:/php/php.exe -q c:/apache2/htdocs/cacti/scripts/test.php


Now I have just replaced the script by this one : Script - Script Server (PHP)
c:/apache2/htdocs/cacti/scripts/ss_my_poller2.php ss_my_poller2


When I go in "System Utilities" - "clear poller Cache", the poller cache no more display any line
Some release ago when I have tested the script poller displayed it.
Consequently, now, the RRD file seems to not be updated anymore


By checking with rrdtool dump the rrdfile, at 22:37 we can see that the file is no more updated

<!-- 2004-08-28 22:20:00 Paris, Madrid / 1093724400 --> <row><v> 1.0393500000e+002 </v></row>
<!-- 2004-08-28 22:25:00 Paris, Madrid / 1093724700 --> <row><v> 1.0393500000e+002 </v></row>
</database>




C:\php>php -v
PHP 4.3.7 (cgi-fcgi) (built: Jun 2 2004 15:49:31)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies


Didier


Attachments:
image1.JPG
image1.JPG [ 63.96 KiB | Viewed 4442 times ]
Top
  
 
 Post subject: Additional elements taht can help you to reproduce the probl
PostPosted: Sat Aug 28, 2004 4:23 pm 
Sorry,
I have forgotten to join some element that can help you

My SQL database,
The PHP script I use and it works, it is the same I had used before
(ss_my_poller2.php.txt to rename in ss_my_poller2.php)

C:\php>php.exe -q C:\apache2\htdocs\cacti\scripts\ss_my_poller2.php ss_my_poller2.php
59


Thanks a lot for your help to help me in understanding what's happening

Didier


Attachments:
ss_my_poller2.php.txt [414 Bytes]
Downloaded 225 times
mysql-dump.txt [168.26 KiB]
Downloaded 235 times
Top
  
 
 Post subject: Same problem with cacti-0.8.6-pre20040829.zip
PostPosted: Sun Aug 29, 2004 6:41 am 
Hello
I have the sdame problem with cacti-0.8.6-pre20040829.zip


My Script - Script Server (PHP is still)
c:/apache2/htdocs/cacti/scripts/ss_my_poller2.php ss_my_poller2

In the log there's nothing : cacti.log

08/29/2004 01:33:50 PM - WEBLOG: Poller[0] RRD: c:/rrdtool/rrdtool.exe graph - --imgformat=PNG --start=1093692829 --end=1093779229 --title="My Title" --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --units-exponent=1 COMMENT:"From 2004/08/28 13:33:49 To 2004/08/29 13:33:49\c" COMMENT:"\n" --vertical-label="" DEF:a="C\:\apache2\htdocs\cacti/rra/didier_ds1_10.rrd":ds1:AVERAGE LINE2:a#4444FF:""
08/29/2004 01:33:54 PM - WEBLOG: Poller[0] RRD: c:/rrdtool/rrdtool.exe graph - --imgformat=PNG --start=1093777434 --end=1093779234 --title="My Title" --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --units-exponent=1 COMMENT:"From 2004/08/29 13:03:54 To 2004/08/29 13:33:54\c" COMMENT:"\n" --vertical-label="" DEF:a="C\:\apache2\htdocs\cacti/rra/didier_ds1_10.rrd":ds1:AVERAGE LINE2:a#4444FF:""
08/29/2004 01:35:00 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process
08/29/2004 01:35:00 PM - CMDPHP: Poller[0] ERROR: Either there are no items in the cache or polling is disabled
08/29/2004 01:35:01 PM - SYSTEM STATS: Time: 1.0681 s, Method: cmd.php, Processes: 1, Threads: N/A, Hosts: 1, Hosts/Process: 1
08/29/2004 01:36:31 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process
08/29/2004 01:36:31 PM - CMDPHP: Poller[0] ERROR: Either there are no items in the cache or polling is disabled
08/29/2004 01:36:32 PM - SYSTEM STATS: Time: 1.0283 s, Method: cmd.php, Processes: 1, Threads: N/A, Hosts: 1, Hosts/Process: 1
08/29/2004 01:40:00 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process
08/29/2004 01:40:00 PM - CMDPHP: Poller[0] ERROR: Either there are no items in the cache or polling is disabled
08/29/2004 01:40:01 PM - SYSTEM STATS: Time: 1.0726 s, Method: cmd.php, Processes: 1, Threads: N/A, Hosts: 1, Hosts/Process: 1


Top
  
 
 Post subject: More in advance in the code to found the reason of the probl
PostPosted: Sun Aug 29, 2004 12:24 pm 
Hello I have analyzed more the code regarding to my problem
It seems that the data_input_data table has no record with the data_template_data_id=72 required
Please who fills normally this table ?
What can be the reason why this table is not filled in ?

Thanks

Didier





====== my trace have been into =============================================================

function update_poller_cache($local_data_id, $truncate_performed = false) {

......
/* we have to perform some additional sql queries if this is a "query" */
if (($data_input["type_id"] == DATA_INPUT_TYPE_SNMP_QUERY) ||
($data_input["type_id"] == DATA_INPUT_TYPE_SCRIPT_QUERY) ||
($data_input["type_id"] == DATA_INPUT_TYPE_PHP_SCRIPT_SERVER) ||
($data_input["type_id"] == DATA_INPUT_TYPE_QUERY_SCRIPT_SERVER)){
$field = data_query_field_list($data_input["data_template_data_id"]);

var_dump( $data_input["data_template_data_id"]); ====> string(2) "72"
var_dump( empty($field) ); ====> bool(true)
var_dump(debug_backtrace()); ====> array(2) { [0]=> array(4) { ["file"]=> string(39) "C:\apache2\htdocs\cacti\lib\utility.php" ["line"]=> int(35) ["function"]=> string(19) "update_poller_cache" ["args"]=> array(2) { [0]=> &string(2) "10" [1]=> &bool(true) } } [1]=> array(4) { ["file"]=> string(37) "C:\apache2\htdocs\cacti\utilities.php" ["line"]=> int(37) ["function"]=> string(23) "repopulate_poller_cache" ["args"]=> array(0) { } } }


if (empty($field)) { return; }

====== which call the following ==========================================================



function data_query_field_list($data_template_data_id) {

var_dump( $data_template_data_id); ====> string(2) "72"
var_dump(debug_backtrace()); ====> array(3) { [0]=> array(4) { ["file"]=> string(39) "C:\apache2\htdocs\cacti\lib\utility.php" ["line"]=> int(70) ["function"]=> string(21) "data_query_field_list" ["args"]=> array(1) { [0]=> &string(2) "72" } } [1]=> array(4) { ["file"]=> string(39) "C:\apache2\htdocs\cacti\lib\utility.php" ["line"]=> int(35) ["function"]=> string(19) "update_poller_cache" ["args"]=> array(2) { [0]=> &string(2) "10" [1]=> &bool(true) } } [2]=> array(4) { ["file"]=> string(37) "C:\apache2\htdocs\cacti\utilities.php" ["line"]=> int(37) ["function"]=> string(23) "repopulate_poller_cache" ["args"]=> array(0) { } } }


$field = db_fetch_assoc("select
data_input_fields.type_code,
data_input_data.value
from data_input_fields,data_input_data
where data_input_fields.id=data_input_data.data_input_field_id
and data_input_data.data_template_data_id=$data_template_data_id
and (data_input_fields.type_code='index_type' or data_input_fields.type_code='index_value' or data_input_fields.type_code='output_type')");

var_dump ($data_template_data_id); ===> string(2) "72"
var_dump( $field ); ====> array(0) { }












CREATE TABLE data_input_fields (
id mediumint(8) unsigned NOT NULL auto_increment,
hash varchar(32) NOT NULL default '',
data_input_id mediumint(8) unsigned NOT NULL default '0',
name varchar(200) NOT NULL default '',
data_name varchar(50) NOT NULL default '',
input_output char(3) NOT NULL default '',
update_rra char(2) default '0',
sequence smallint(5) NOT NULL default '0',
type_code varchar(40) default NULL,
regexp_match varchar(200) default NULL,
allow_nulls char(2) default NULL,
PRIMARY KEY (id),
UNIQUE KEY ID (id),
KEY id_2 (id),
KEY data_input_id (data_input_id)
) TYPE=MyISAM;

--
-- Dumping data for table `data_input_fields`
--
INSERT INTO data_input_fields VALUES (1,'92f5906c8dc0f964b41f4253df582c38',1,'SNMP IP Address','management_ip','in','',0,'hostname','','');
INSERT INTO data_input_fields VALUES (2,'32285d5bf16e56c478f5e83f32cda9ef',1,'SNMP Community','snmp_community','in','',0,'snmp_community','','');
INSERT INTO data_input_fields VALUES (3,'ad14ac90641aed388139f6ba86a2e48b',1,'SNMP Username','snmp_username','in','',0,'snmp_username','','on');
INSERT INTO data_input_fields VALUES (4,'9c55a74bd571b4f00a96fd4b793278c6',1,'SNMP Password','snmp_password','in','',0,'snmp_password','','on');
INSERT INTO data_input_fields VALUES (5,'012ccb1d3687d3edb29c002ea66e72da',1,'SNMP Version (1, 2, or 3)','snmp_version','in','',0,'snmp_version','','on');
INSERT INTO data_input_fields VALUES (6,'4276a5ec6e3fe33995129041b1909762',1,'OID','oid','in','',0,'snmp_oid','','');
INSERT INTO data_input_fields VALUES (7,'617cdc8a230615e59f06f361ef6e7728',2,'SNMP IP Address','management_ip','in','',0,'hostname','','');
INSERT INTO data_input_fields VALUES (8,'acb449d1451e8a2a655c2c99d31142c7',2,'SNMP Community','snmp_community','in','',0,'snmp_community','','');
INSERT INTO data_input_fields VALUES (9,'f4facc5e2ca7ebee621f09bc6d9fc792',2,'SNMP Username (v3)','snmp_username','in','',0,'snmp_username','','on');
INSERT INTO data_input_fields VALUES (10,'1cc1493a6781af2c478fa4de971531cf',2,'SNMP Password (v3)','snmp_password','in','',0,'snmp_password','','on');
INSERT INTO data_input_fields VALUES (11,'b5c23f246559df38662c255f4aa21d6b',2,'SNMP Version (1, 2, or 3)','snmp_version','in','',0,'snmp_version','','');
INSERT INTO data_input_fields VALUES (12,'6027a919c7c7731fbe095b6f53ab127b',2,'Index Type','index_type','in','',0,'index_type','','');
INSERT INTO data_input_fields VALUES (13,'cbbe5c1ddfb264a6e5d509ce1c78c95f',2,'Index Value','index_value','in','',0,'index_value','','');
INSERT INTO data_input_fields VALUES (14,'e6deda7be0f391399c5130e7c4a48b28',2,'Output Type ID','output_type','in','',0,'output_type','','');
INSERT INTO data_input_fields VALUES (15,'edfd72783ad02df128ff82fc9324b4b9',3,'Disk Partition','partition','in','',1,'','','');
INSERT INTO data_input_fields VALUES (16,'8b75fb61d288f0b5fc0bd3056af3689b',3,'Kilobytes Free','kilobytes','out','on',0,'','','');
INSERT INTO data_input_fields VALUES (17,'363588d49b263d30aecb683c52774f39',4,'1 Minute Average','1min','out','on',0,'','','');
INSERT INTO data_input_fields VALUES (18,'ad139a9e1d69881da36fca07889abf58',4,'5 Minute Average','5min','out','on',0,'','','');
INSERT INTO data_input_fields VALUES (19,'5db9fee64824c08258c7ff6f8bc53337',4,'10 Minute Average','10min','out','on',0,'','','');
INSERT INTO data_input_fields VALUES (20,'c0cfd0beae5e79927c5a360076706820',5,'Username (Optional)','username','in','',1,'','','on');
INSERT INTO data_input_fields VALUES (21,'52c58ad414d9a2a83b00a7a51be75a53',5,'Logged In Users','users','out','on',0,'','','');
INSERT INTO data_input_fields VALUES (22,'05eb5d710f0814871b8515845521f8d7',6,'Grep String','grepstr','in','',1,'','','');
INSERT INTO data_input_fields VALUES (23,'86cb1cbfde66279dbc7f1144f43a3219',6,'Result (in Kilobytes)','kilobytes','out','on',0,'','','');
INSERT INTO data_input_fields VALUES (24,'d5a8dd5fbe6a5af11667c0039af41386',7,'Number of Processes','proc','out','on',0,'','','');
INSERT INTO data_input_fields VALUES (25,'8848cdcae831595951a3f6af04eec93b',8,'Grep String','grepstr','in','',1,'','','on');
INSERT INTO data_input_fields VALUES (26,'3d1288d33008430ce354e8b9c162f7ff',8,'Connections','connections','out','on',0,'','','');
INSERT INTO data_input_fields VALUES (27,'c6af570bb2ed9c84abf32033702e2860',9,'(Optional) Log Path','log_path','in','',1,'','','on');
INSERT INTO data_input_fields VALUES (28,'f9389860f5c5340c9b27fca0b4ee5e71',9,'Web Hits','webhits','out','on',0,'','','');
INSERT INTO data_input_fields VALUES (29,'5fbadb91ad66f203463c1187fe7bd9d5',10,'IP Address','ip','in','',1,'hostname','','');
INSERT INTO data_input_fields VALUES (30,'6ac4330d123c69067d36a933d105e89a',10,'Milliseconds','out_ms','out','on',0,'','','');
INSERT INTO data_input_fields VALUES (31,'d39556ecad6166701bfb0e28c5a11108',11,'Index Type','index_type','in','',0,'index_type','','');
INSERT INTO data_input_fields VALUES (32,'3b7caa46eb809fc238de6ef18b6e10d5',11,'Index Value','index_value','in','',0,'index_value','','');
INSERT INTO data_input_fields VALUES (33,'74af2e42dc12956c4817c2ef5d9983f9',11,'Output Type ID','output_type','in','',0,'output_type','','');
INSERT INTO data_input_fields VALUES (34,'8ae57f09f787656bf4ac541e8bd12537',11,'Output Value','output','out','on',0,'','','');
INSERT INTO data_input_fields VALUES (35,'172b4b0eacee4948c6479f587b62e512',12,'Index Type','index_type','in','',0,'index_type','','');
INSERT INTO data_input_fields VALUES (36,'30fb5d5bcf3d66bb5abe88596f357c26',12,'Index Value','index_value','in','',0,'index_value','','');
INSERT INTO data_input_fields VALUES (37,'31112c85ae4ff821d3b288336288818c',12,'Output Type ID','output_type','in','',0,'output_type','','');
INSERT INTO data_input_fields VALUES (38,'5be8fa85472d89c621790b43510b5043',12,'Output Value','output','out','on',0,'','','');
INSERT INTO data_input_fields VALUES (39,'378504f0ca01a9b6e666a50cd1205f4e',13,'out1','Output1','out','on',0,'','','');


CREATE TABLE data_input_data (
data_input_field_id mediumint(8) unsigned NOT NULL default '0',
data_template_data_id mediumint(8) unsigned NOT NULL default '0',
t_value char(2) default NULL,
value text,
PRIMARY KEY (data_input_field_id,data_template_data_id),
KEY data_input_field_id (data_input_field_id,data_template_data_id)
) TYPE=MyISAM;

--
-- Dumping data for table `data_input_data`
--
INSERT INTO data_input_data VALUES (14,1,'on','');
INSERT INTO data_input_data VALUES (13,1,'on','');
INSERT INTO data_input_data VALUES (12,1,'on','');
INSERT INTO data_input_data VALUES (14,2,'on','');
INSERT INTO data_input_data VALUES (13,2,'on','');
INSERT INTO data_input_data VALUES (12,2,'on','');
INSERT INTO data_input_data VALUES (14,3,'on','');
INSERT INTO data_input_data VALUES (13,3,'on','');
INSERT INTO data_input_data VALUES (12,3,'on','');
INSERT INTO data_input_data VALUES (1,4,'','');
INSERT INTO data_input_data VALUES (1,5,'','');
INSERT INTO data_input_data VALUES (1,6,'','');
INSERT INTO data_input_data VALUES (14,7,'on','');
INSERT INTO data_input_data VALUES (13,7,'on','');
INSERT INTO data_input_data VALUES (12,7,'on','');
INSERT INTO data_input_data VALUES (14,8,'on','');
INSERT INTO data_input_data VALUES (13,8,'on','');
INSERT INTO data_input_data VALUES (12,8,'on','');
INSERT INTO data_input_data VALUES (14,9,'on','');
INSERT INTO data_input_data VALUES (13,9,'on','');
INSERT INTO data_input_data VALUES (12,9,'on','');
INSERT INTO data_input_data VALUES (14,10,'on','');
INSERT INTO data_input_data VALUES (13,10,'on','');
INSERT INTO data_input_data VALUES (12,10,'on','');
INSERT INTO data_input_data VALUES (22,12,'','Buffers:');
INSERT INTO data_input_data VALUES (22,13,'','MemFree:');
INSERT INTO data_input_data VALUES (22,14,'','^Cached:');
INSERT INTO data_input_data VALUES (22,15,'','SwapFree:');
INSERT INTO data_input_data VALUES (29,18,'on','');
INSERT INTO data_input_data VALUES (1,19,'','');
INSERT INTO data_input_data VALUES (2,19,'','');
INSERT INTO data_input_data VALUES (6,21,'','.1.3.6.1.2.1.25.3.3.1.2.1');
INSERT INTO data_input_data VALUES (1,27,'','');
INSERT INTO data_input_data VALUES (6,28,'','.1.3.6.1.4.1.9.9.109.1.1.1.1.3.1');
INSERT INTO data_input_data VALUES (6,29,'','.1.3.6.1.4.1.9.9.109.1.1.1.1.4.1');
INSERT INTO data_input_data VALUES (1,30,'','');
INSERT INTO data_input_data VALUES (1,31,'','');
INSERT INTO data_input_data VALUES (1,32,'','');
INSERT INTO data_input_data VALUES (1,33,'','');
INSERT INTO data_input_data VALUES (1,34,'','');
INSERT INTO data_input_data VALUES (14,35,'on','');
INSERT INTO data_input_data VALUES (13,35,'on','');
INSERT INTO data_input_data VALUES (12,35,'on','');
INSERT INTO data_input_data VALUES (14,36,'on','');
INSERT INTO data_input_data VALUES (13,36,'on','');
INSERT INTO data_input_data VALUES (12,36,'on','');
INSERT INTO data_input_data VALUES (1,22,'','');
INSERT INTO data_input_data VALUES (1,23,'','');
INSERT INTO data_input_data VALUES (1,24,'','');
INSERT INTO data_input_data VALUES (1,25,'','');
INSERT INTO data_input_data VALUES (1,26,'','');
INSERT INTO data_input_data VALUES (33,37,'on','');
INSERT INTO data_input_data VALUES (32,37,'on','');
INSERT INTO data_input_data VALUES (31,37,'on','');
INSERT INTO data_input_data VALUES (14,38,'on','');
INSERT INTO data_input_data VALUES (13,38,'on','');
INSERT INTO data_input_data VALUES (12,38,'on','');
INSERT INTO data_input_data VALUES (14,39,'on','');
INSERT INTO data_input_data VALUES (13,39,'on','');
INSERT INTO data_input_data VALUES (12,39,'on','');
INSERT INTO data_input_data VALUES (14,40,'on','');
INSERT INTO data_input_data VALUES (13,40,'on','');
INSERT INTO data_input_data VALUES (12,40,'on','');
INSERT INTO data_input_data VALUES (14,41,'on','');
INSERT INTO data_input_data VALUES (13,41,'on','');
INSERT INTO data_input_data VALUES (12,41,'on','');
INSERT INTO data_input_data VALUES (14,55,'on','');
INSERT INTO data_input_data VALUES (13,55,'on','');
INSERT INTO data_input_data VALUES (12,55,'on','');
INSERT INTO data_input_data VALUES (37,56,'on','');
INSERT INTO data_input_data VALUES (36,56,'on','');
INSERT INTO data_input_data VALUES (35,56,'on','');
INSERT INTO data_input_data VALUES (37,57,'on','');
INSERT INTO data_input_data VALUES (36,57,'on','');
INSERT INTO data_input_data VALUES (35,57,'on','');
INSERT INTO data_input_data VALUES (1,58,'','');
INSERT INTO data_input_data VALUES (1,59,'','');
INSERT INTO data_input_data VALUES (1,20,'','');
INSERT INTO data_input_data VALUES (5,6,'','');
INSERT INTO data_input_data VALUES (4,6,'','');
INSERT INTO data_input_data VALUES (3,6,'','');
INSERT INTO data_input_data VALUES (2,6,'','');
INSERT INTO data_input_data VALUES (6,69,'on','');
INSERT INTO data_input_data VALUES (1,68,'','');
INSERT INTO data_input_data VALUES (2,68,'','');
INSERT INTO data_input_data VALUES (6,6,'','.1.3.6.1.4.1.2021.11.51.0');
INSERT INTO data_input_data VALUES (2,27,'','');
INSERT INTO data_input_data VALUES (3,27,'','');
INSERT INTO data_input_data VALUES (4,27,'','');
INSERT INTO data_input_data VALUES (5,27,'','');
INSERT INTO data_input_data VALUES (6,27,'','.1.3.6.1.4.1.9.2.1.58.0');
INSERT INTO data_input_data VALUES (2,59,'','');
INSERT INTO data_input_data VALUES (3,59,'','');
INSERT INTO data_input_data VALUES (4,59,'','');
INSERT INTO data_input_data VALUES (5,59,'','');
INSERT INTO data_input_data VALUES (6,59,'','.1.3.6.1.2.1.25.1.5.0');
INSERT INTO data_input_data VALUES (2,58,'','');
INSERT INTO data_input_data VALUES (3,58,'','');
INSERT INTO data_input_data VALUES (4,58,'','');
INSERT INTO data_input_data VALUES (5,58,'','');
INSERT INTO data_input_data VALUES (6,58,'','.1.3.6.1.2.1.25.1.6.0');
INSERT INTO data_input_data VALUES (2,24,'','');
INSERT INTO data_input_data VALUES (3,24,'','');
INSERT INTO data_input_data VALUES (4,24,'','');
INSERT INTO data_input_data VALUES (5,24,'','');
INSERT INTO data_input_data VALUES (6,24,'','.1.3.6.1.4.1.23.2.28.2.5.0');
INSERT INTO data_input_data VALUES (2,25,'','');
INSERT INTO data_input_data VALUES (3,25,'','');
INSERT INTO data_input_data VALUES (4,25,'','');
INSERT INTO data_input_data VALUES (5,25,'','');
INSERT INTO data_input_data VALUES (6,25,'','.1.3.6.1.4.1.23.2.28.2.6.0');
INSERT INTO data_input_data VALUES (2,22,'','');
INSERT INTO data_input_data VALUES (3,22,'','');
INSERT INTO data_input_data VALUES (4,22,'','');
INSERT INTO data_input_data VALUES (5,22,'','');
INSERT INTO data_input_data VALUES (6,22,'','.1.3.6.1.4.1.23.2.28.2.1.0');
INSERT INTO data_input_data VALUES (2,23,'','');
INSERT INTO data_input_data VALUES (3,23,'','');
INSERT INTO data_input_data VALUES (4,23,'','');
INSERT INTO data_input_data VALUES (5,23,'','');
INSERT INTO data_input_data VALUES (6,23,'','.1.3.6.1.4.1.23.2.28.2.2.0');
INSERT INTO data_input_data VALUES (2,26,'','');
INSERT INTO data_input_data VALUES (3,26,'','');
INSERT INTO data_input_data VALUES (4,26,'','');
INSERT INTO data_input_data VALUES (5,26,'','');
INSERT INTO data_input_data VALUES (6,26,'','.1.3.6.1.4.1.23.2.28.2.7.0');
INSERT INTO data_input_data VALUES (2,20,'','');
INSERT INTO data_input_data VALUES (3,20,'','');
INSERT INTO data_input_data VALUES (4,20,'','');
INSERT INTO data_input_data VALUES (5,20,'','');
INSERT INTO data_input_data VALUES (6,20,'','.1.3.6.1.4.1.23.2.28.3.2.0');
INSERT INTO data_input_data VALUES (3,19,'','');
INSERT INTO data_input_data VALUES (4,19,'','');
INSERT INTO data_input_data VALUES (5,19,'','');
INSERT INTO data_input_data VALUES (6,19,'','.1.3.6.1.4.1.23.2.28.3.1');
INSERT INTO data_input_data VALUES (2,4,'','');
INSERT INTO data_input_data VALUES (3,4,'','');
INSERT INTO data_input_data VALUES (4,4,'','');
INSERT INTO data_input_data VALUES (5,4,'','');
INSERT INTO data_input_data VALUES (6,4,'','.1.3.6.1.4.1.2021.11.52.0');
INSERT INTO data_input_data VALUES (2,5,'','');
INSERT INTO data_input_data VALUES (3,5,'','');
INSERT INTO data_input_data VALUES (4,5,'','');
INSERT INTO data_input_data VALUES (5,5,'','');
INSERT INTO data_input_data VALUES (6,5,'','.1.3.6.1.4.1.2021.11.50.0');
INSERT INTO data_input_data VALUES (2,30,'','');
INSERT INTO data_input_data VALUES (3,30,'','');
INSERT INTO data_input_data VALUES (4,30,'','');
INSERT INTO data_input_data VALUES (5,30,'','');
INSERT INTO data_input_data VALUES (6,30,'','.1.3.6.1.4.1.2021.10.1.3.1');
INSERT INTO data_input_data VALUES (2,32,'','');
INSERT INTO data_input_data VALUES (3,32,'','');
INSERT INTO data_input_data VALUES (4,32,'','');
INSERT INTO data_input_data VALUES (5,32,'','');
INSERT INTO data_input_data VALUES (6,32,'','.1.3.6.1.4.1.2021.10.1.3.3');
INSERT INTO data_input_data VALUES (2,31,'','');
INSERT INTO data_input_data VALUES (3,31,'','');
INSERT INTO data_input_data VALUES (4,31,'','');
INSERT INTO data_input_data VALUES (5,31,'','');
INSERT INTO data_input_data VALUES (6,31,'','.1.3.6.1.4.1.2021.10.1.3.2');
INSERT INTO data_input_data VALUES (2,33,'','');
INSERT INTO data_input_data VALUES (3,33,'','');
INSERT INTO data_input_data VALUES (4,33,'','');
INSERT INTO data_input_data VALUES (5,33,'','');
INSERT INTO data_input_data VALUES (6,33,'','.1.3.6.1.4.1.2021.4.14.0');
INSERT INTO data_input_data VALUES (3,68,'','');
INSERT INTO data_input_data VALUES (4,68,'','');
INSERT INTO data_input_data VALUES (5,68,'','');
INSERT INTO data_input_data VALUES (6,68,'','.1.3.6.1.4.1.2021.4.15.0');
INSERT INTO data_input_data VALUES (2,34,'','');
INSERT INTO data_input_data VALUES (3,34,'','');
INSERT INTO data_input_data VALUES (4,34,'','');
INSERT INTO data_input_data VALUES (5,34,'','');
INSERT INTO data_input_data VALUES (6,34,'','.1.3.6.1.4.1.2021.4.6.0');
INSERT INTO data_input_data VALUES (20,17,'','');


Top
  
 
 Post subject: Has anybody encountered the same problem ?
PostPosted: Mon Aug 30, 2004 1:59 pm 
Has anybody encountered the same problem ?
Has anyboday be able to reproduce it ?

Can anybod explain me how to use these PHP script server if I'm wrong.
It was working some release ago with what I'm doing now.

I have it agin on cacti-0.8.6-pre20040830.zip
I have recreated anything

Thanks

Didier


Top
  
 
 Post subject:
PostPosted: Mon Aug 30, 2004 2:56 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14861
Location: MI, USA
Didier,

I have modified the script server to work with no input parameters. This is likely what caused the script to stop working. If you require no parameters, then simply issue the command without any parameters.

TheWitness (Aol IM: PhyntmVygr)

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Last edited by TheWitness on Mon Aug 30, 2004 3:20 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 30, 2004 3:06 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14861
Location: MI, USA
Didier,

I have corrected your code. Please note the subtle difference in it. Please note, you must still call as you had described. (c:\wwwroot\cacti\scripts\ss_my_poller.php ss_my_poller).

Since there are no calling parameters, you use the "call_user_func" instead of "call_user_func_array".

TheWitness

<?php
$no_http_headers = true;

/* display No errors */
error_reporting(E_ERROR);

include_once(dirname(__FILE__) . "/../include/config.php");
include_once(dirname(__FILE__) . "/../lib/snmp.php");

if (!isset($called_by_script_server)) {
print call_user_func("ss_my_poller2");
}

function ss_my_poller2() {

return rand (0,200);
}
?>

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Sorry, it is not working
PostPosted: Mon Aug 30, 2004 3:50 pm 
Thanks a lot Larry,
You are the best in coding.
But sorry it's still not working

When I do Clear Poller cache
I still have "View Poller Cache [0 Item]"

So it is not as before when it was working I was able to see the PHP script. But here nothing. The problem for me is somewhere else.

Didier


Top
  
 
 Post subject:
PostPosted: Mon Aug 30, 2004 4:15 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14861
Location: MI, USA
You need to assign a graph to the output of the Data Query. Then you should get output in your Poller Cache.

TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Does this mean PHP script server doesn't work with data inpu
PostPosted: Tue Aug 31, 2004 3:13 pm 
Hi Larry,

Thanks for your answer

I'm using data input not data query, does this mean we cannot use it with a a data input method ?
Below what I'm doing
Join a sql file.
I'll try again on previous releases to see if it was working.

Didier

==========
Devices
DIDIER 127.0.0.1

Data Input Methods
Script - Script Server (PHP)
c:\apache2\htdocs\cacti\scripts\ss_my_poller2.php ss_my_poller2
Output Fields = out1
Name = DIDIERINPUT

Data Source

Host: DIDIER (127.0.0.1)
Data Input method: DIDIER INPUT
Internal Data Source Name: DIDIER

Graph Management
Host: DIDIER (127.0.0.1)
Title: DIDIERTITLE
Unit Exponent Value: 1

Graph Items
Data Source : Didier - DIDIER (DIDIER)
Color
Graph Item Type : Line2
Graph Tree
Create header DIDIERHEADER
Add the graph + host


Attachments:
DIDIER.cacti.sql.txt [164.75 KiB]
Downloaded 284 times
Top
  
 
 Post subject: May be the fix for the problem
PostPosted: Tue Aug 31, 2004 5:00 pm 
Hello,

In the function - file utitlity.php
can any body tell me when the condition is true for
-$data_input["type_id"] == DATA_INPUT_TYPE_PHP_SCRIPT_SERVER)
- $field = data_query_field_list($data_input["data_template_data_id"]); which is not empty

In my case (Data Input method + PHP script server), the data_template_data_id seems to not be filled in


To correct it proceed as following
See joined file you will "View Poller Cache [1 Items] "
In this case when the poller.php will be executed the rrd file will be created and the graph displayed !!!!!



I have noticed that when you comment /* if (empty($field)) { return; } */ in the folling function a Clear Cache Poller make the poller appear even for a Data Input Methods which is a PHP Script Server. Are you sure there is no bug in the code ?

function update_poller_cache($local_data_id, $truncate_performed = false) {
.......
/* we have to perform some additional sql queries if this is a "query" */
if (($data_input["type_id"] == DATA_INPUT_TYPE_SNMP_QUERY) ||
($data_input["type_id"] == DATA_INPUT_TYPE_SCRIPT_QUERY) ||
($data_input["type_id"] == DATA_INPUT_TYPE_PHP_SCRIPT_SERVER) ||
($data_input["type_id"] == DATA_INPUT_TYPE_QUERY_SCRIPT_SERVER)){
$field = data_query_field_list($data_input["data_template_data_id"]);

/* if (empty($field)) { return; } ****** HERE IT IS THE LINE */

$outputs = db_fetch_assoc("select
snmp_query_graph_rrd.snmp_field_name,
data_template_rrd.id as data_template_rrd_id
from snmp_query_graph_rrd,data_template_rrd
where snmp_query_graph_rrd.data_template_rrd_id=data_template_rrd.local_data_template_rrd_id
and snmp_query_graph_rrd.snmp_query_graph_id=" . $field["output_type"] . "
and snmp_query_graph_rrd.data_template_id=" . $data_input["data_template_id"] . "
and data_template_rrd.local_data_id=$local_data_id");
}


Didier


Attachments:
image1.JPG
image1.JPG [ 78.9 KiB | Viewed 4378 times ]
Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

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