Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sun Jun 16, 2019 3:48 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: WMI for 1.2.3
PostPosted: Tue May 21, 2019 4:25 pm 
Offline

Joined: Fri Jun 27, 2008 8:38 pm
Posts: 7
Been trying to install WMI for Cacti ver 1.2.3 but I'm having problems in doing so. When I copied file files into the ..plugins directory, I accidentally copied to WMI folder instead of WMIC. Because of this I got this error:

2019/05/22 04:23:52 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins.php[74]:api_plugin_install(), /lib/plugins.php[590]:include_once(), /lib/plugins.php[590]:CactiErrorHandler())
2019/05/22 04:23:52 - ERROR PHP WARNING: include_once(): Failed opening '/var/www/html/plugins/wmic/setup.php' for inclusion (include_path='.:/usr/share/php') in file: /var/www/html/lib/plugins.php on line: 590
2019/05/22 04:23:52 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins.php[74]:api_plugin_install(), /lib/plugins.php[590]:include_once(), /lib/plugins.php[590]:CactiErrorHandler())
2019/05/22 04:23:52 - ERROR PHP WARNING: include_once(/var/www/html/plugins/wmic/setup.php): failed to open stream: No such file or directory in file: /var/www/html/lib/plugins.php on line: 590

But when I updated the directory from WMI to WMIC, nothing happens into the portal and no logs are written for the server. please help. thank you.


Top
 Profile  
 
 Post subject: Re: WMI for 1.2.3
PostPosted: Wed May 22, 2019 11:32 am 
Offline

Joined: Fri Jun 27, 2008 8:38 pm
Posts: 7
ncariaga wrote:
Been trying to install WMI for Cacti ver 1.2.3 but I'm having problems in doing so. When I copied file files into the ..plugins directory, I accidentally copied to WMI folder instead of WMIC. Because of this I got this error:

2019/05/22 04:23:52 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins.php[74]:api_plugin_install(), /lib/plugins.php[590]:include_once(), /lib/plugins.php[590]:CactiErrorHandler())
2019/05/22 04:23:52 - ERROR PHP WARNING: include_once(): Failed opening '/var/www/html/plugins/wmic/setup.php' for inclusion (include_path='.:/usr/share/php') in file: /var/www/html/lib/plugins.php on line: 590
2019/05/22 04:23:52 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins.php[74]:api_plugin_install(), /lib/plugins.php[590]:include_once(), /lib/plugins.php[590]:CactiErrorHandler())
2019/05/22 04:23:52 - ERROR PHP WARNING: include_once(/var/www/html/plugins/wmic/setup.php): failed to open stream: No such file or directory in file: /var/www/html/lib/plugins.php on line: 590

But when I updated the directory from WMI to WMIC, nothing happens into the portal and no logs are written for the server. please help. thank you.


I was able to go about the error above by changing the package info from WMIC to WMI. However, when tried installing the file, I notice this error prompting
Attachment:
Capture.JPG
Capture.JPG [ 21.37 KiB | Viewed 135 times ]


I hope someone could help out on this. Thank you very much in advance.


Top
 Profile  
 
 Post subject: Re: WMI for 1.2.3
PostPosted: Wed May 22, 2019 1:32 pm 
Offline

Joined: Fri Jun 27, 2008 8:38 pm
Posts: 7
After viewing the log files, I found these log entries. I was hoping someone could help me figure out what went wrong:

2019/05/23 02:21:40 - CMDPHP SQL Backtrace: (/plugins.php[74]:api_plugin_install(), /lib/plugins.php[626]:plugin_wmi_install(), /plugins/wmi/setup.php[41]:plugin_wmi_setup_tables(), /plugins/wmi/setup.php[186]:sql_save())
2019/05/23 02:21:40 - DBCALL ERROR: SQL Save on table 'Array': Table does not exist, unable to save!
2019/05/23 02:21:40 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins.php[74]:api_plugin_install(), /lib/plugins.php[626]:plugin_wmi_install(), /plugins/wmi/setup.php[41]:plugin_wmi_setup_tables(), /plugins/wmi/setup.php[186]:sql_save(), /lib/database.php[1342]:CactiErrorHandler())
2019/05/23 02:21:40 - ERROR PHP NOTICE: Array to string conversion in file: /var/www/html/lib/database.php on line: 1342
2019/05/23 02:21:40 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins.php[74]:api_plugin_install(), /lib/plugins.php[626]:plugin_wmi_install(), /plugins/wmi/setup.php[41]:plugin_wmi_setup_tables(), /plugins/wmi/setup.php[186]:sql_save(), /lib/database.php[1341]:db_table_exists(), /lib/database.php[730]:array_key_exists(), CactiErrorHandler())
2019/05/23 02:21:40 - ERROR PHP WARNING: array_key_exists() expects parameter 2 to be array, null given in file: /var/www/html/lib/database.php on line: 730
2019/05/23 02:21:40 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins.php[74]:api_plugin_install(), /lib/plugins.php[626]:plugin_wmi_install(), /plugins/wmi/setup.php[41]:plugin_wmi_setup_tables(), /plugins/wmi/setup.php[186]:sql_save(), /lib/database.php[1341]:db_table_exists(), /lib/database.php[729]:preg_match(), CactiErrorHandler())
2019/05/23 02:21:40 - ERROR PHP WARNING: preg_match() expects parameter 2 to be string, array given in file: /var/www/html/lib/database.php on line: 729
2019/05/23 02:21:40 - CMDPHP SQL Backtrace: (/plugins.php[74]:api_plugin_install(), /lib/plugins.php[626]:plugin_wmi_install(), /plugins/wmi/setup.php[41]:plugin_wmi_setup_tables(), /plugins/wmi/setup.php[179]:db_fetch_cell(), /lib/database.php[358]:db_fetch_cell_prepared(), /lib/database.php[374]:db_execute_prepared())
2019/05/23 02:21:40 - CMDPHP ERROR: A DB Cell Failed!, Error: Unknown column 'id' in 'field list'


Top
 Profile  
 
 Post subject: Re: WMI for 1.2.3
PostPosted: Tue May 28, 2019 2:03 pm 
Offline

Joined: Tue May 28, 2019 1:04 pm
Posts: 1
Let's look at code
1) wrong plugin name in INFO, but in scripts all paths begin with $config['base_path'] . '/plugins/wmi/
2) /plugins/wmi/setup.php[186]:sql_save()
wrong arguments order in call at
it should be
Code:
$id = sql_save($save, 'data_input');

3) /plugins/wmi/setup.php[179]:db_fetch_cell()
Code:
$exists = db_fetch_cell('SELECT id FROM data_input_data WHERE hash="4af550dfe8b451579054d038ad62ba3e"');

It's wrong table in this row, data_input_data doesn't have columns id and hash
lets write data_input
4)db_execute("INSERT INTO `data_input_fields`
must be without first column id
VALUES (98,

summary:
Code:
diff setup.php setup.php.git
179c179
<       $exists = db_fetch_cell('SELECT id FROM data_input WHERE hash="4af550dfe8b451579054d038ad62ba3e"');
---
>       $exists = db_fetch_cell('SELECT id FROM data_input_data WHERE hash="4af550dfe8b451579054d038ad62ba3e"');
186c186
<               $id = sql_save($save, 'data_input');
---
>               $id = sql_save('data_input', $save);
199c199
<       $exists = db_fetch_cell('SELECT id FROM data_input WHERE hash="42e584b81075f6ad6556e62afc509179"');
---
>       $exists = db_fetch_cell('SELECT id FROM data_input_data WHERE hash="42e584b81075f6ad6556e62afc509179"');
206c206
<               $id = sql_save($save, 'data_input');
---
>               $id = sql_save('data_input', $save);
211c211
<                               VALUES ('fb6317f2c49e494007e968283576d5a8',$id,'The WMI Class Name','class','in','',0,'','','')");
---
>                               VALUES (96,'fb6317f2c49e494007e968283576d5a8',$id,'The WMI Class Name','class','in','',0,'','','')");
215c215
<                               VALUES ('cfebf9aa08f98bc1bfda7de2ebe12d94',$id,'The WMI Column Name','column','in','',0,'','','')");
---
>                               VALUES (97,'cfebf9aa08f98bc1bfda7de2ebe12d94',$id,'The WMI Column Name','column','in','',0,'','','')");
219c219
<                               VALUES ('41798400f48141c25bc2407b5f5b1573',$id,'Output Type ID','output_type','in','',0,'output_type','','')");
---
>                               VALUES (98,'41798400f48141c25bc2407b5f5b1573',$id,'Output Type ID','output_type','in','',0,'output_type','','')");
223c223
<                               VALUES ('02cd18a75a17e0a7d4ca28bc224630e0',$id,'Output Value','output','out','on',0,'','','')");
---
>                               VALUES (99,'02cd18a75a17e0a7d4ca28bc224630e0',$id,'Output Value','output','out','on',0,'','','')");


Attachments:
cacti_wmi_query_tool.PNG
cacti_wmi_query_tool.PNG [ 39.33 KiB | Viewed 111 times ]
Top
 Profile  
 
 Post subject: Re: WMI for 1.2.3
PostPosted: Fri Jun 07, 2019 3:04 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2499
I believe that you submitted this as a change on the repo and it has now been committed.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


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

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


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