|
|
| Author |
Message |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12295 Location: Muenster, Germany
|
Posted: Wed Dec 19, 2007 3:30 pm Post subject: |
|
|
The scripts were never officially supported by The Cacti Group. But as they are really useful, we implemented same functionality with cacti 087. Find cli scripts in the cli directory. Docs are available the the third link of my signature
Reinhard
|
|
| Back to top |
|
 |
Rael Cacti User
Joined: 05 Apr 2007 Posts: 128
|
Posted: Thu Dec 20, 2007 11:06 am Post subject: |
|
|
add_tree.php doesn't seem to work?
proj/netops/cacti/php/bin/php add_tree.php --type=node --node-type=host --tree-id=200 --host-id=214
It returns that it successfully added it, but I look on cacti and don't see it?
|
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12295 Location: Muenster, Germany
|
Posted: Thu Dec 20, 2007 3:15 pm Post subject: |
|
|
Please post output of | Code: | | php -q add_tree.php --list-nodes --tree-id=200 | You may scratch confidential information
Reinhard
|
|
| Back to top |
|
 |
Rael Cacti User
Joined: 05 Apr 2007 Posts: 128
|
Posted: Fri Dec 21, 2007 9:57 am Post subject: |
|
|
I think I figured it out. I'll test again and see.
I was adding --type=node instead of --type=Graph Template
|
|
| Back to top |
|
 |
timi Cacti User
Joined: 09 Nov 2005 Posts: 129 Location: Timisoara, Romania
|
Posted: Fri Dec 21, 2007 11:05 am Post subject: |
|
|
the problem is that if you have lots of ds then you need to add some indexes to your tables, else it would take hours to add a device into cacti ...
becouse some rows from this select | Code: | "SELECT DISTINCT
data_input_fields.data_name AS `name`,
data_input_fields.name AS `description`,
data_input_data.value AS `default`,
data_template_data.data_template_id,
data_input_fields.id AS `data_input_field_id`
FROM data_input_data
INNER JOIN (((data_template_rrd
INNER JOIN (graph_templates
INNER JOIN graph_templates_item
ON graph_templates.id = graph_templates_item.graph_template_id)
ON data_template_rrd.id = graph_templates_item.task_item_id)
INNER JOIN data_template_data
ON data_template_rrd.data_template_id=data_template_data.data_template_id)
INNER JOIN data_input_fields
ON data_template_data.data_input_id=data_input_fields.data_input_id)
ON (data_input_data.data_template_data_id = data_template_data.id)
AND (data_input_data.data_input_field_id = data_input_fields.id)
WHERE (((graph_templates.id)=$templateId)
AND ((data_input_data.t_value)='on')
AND ((data_input_fields.input_output)='in'))" |
which is in api_automation_tools.php are not indexed.
|
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12295 Location: Muenster, Germany
|
Posted: Fri Dec 21, 2007 12:21 pm Post subject: |
|
|
Yes, there's already a feature request for this. Will be incorporated in next release
Reinhard
|
|
| Back to top |
|
 |
timi Cacti User
Joined: 09 Nov 2005 Posts: 129 Location: Timisoara, Romania
|
Posted: Sun Dec 23, 2007 11:30 am Post subject: |
|
|
here is a little script in perl to add a cisco router/switch in cacti using the php scripts from cli directory, it currently add only fastethernet , gigabit , tenge and portchannels interfaces, if anybody needs more let me know ...
rename cisco.pl.txt to cisco.pl, move it to cli/
run ./cisco.pl device_name ip_address
read the comments...
| Description: |
|
 Download |
| Filename: |
cisco.pl.txt |
| Filesize: |
15.46 KB |
| Downloaded: |
233 Time(s) |
|
|
| Back to top |
|
 |
seichimaru
Joined: 02 Jul 2007 Posts: 6
|
Posted: Wed Jan 02, 2008 2:48 am Post subject: ds graphs are not updating... |
|
|
hi,
im still having a hard time figuring out why does my ds graphs(interface traffic) are not updating although all my cg graphs(ping latency test) are working.
the logs says:
01/02/2008 03:26:32 PM - SPINE: Poller[0] Host[2] DS[10] WARNING: Result from SNMP not valid. Partial Result: ...
01/02/2008 03:26:32 PM - SPINE: Poller[0] Host[2] DS[10] WARNING: Result from SNMP not valid. Partial Result: ...
i already looked almost everywhere in this forum and i haven't found any possible problem associated with mine...am i the only one experiencing this?
i hope to hear from you guys soon...
jeff
|
|
| Back to top |
|
 |
seichimaru
Joined: 02 Jul 2007 Posts: 6
|
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12295 Location: Muenster, Germany
|
Posted: Thu Jan 03, 2008 1:52 pm Post subject: Re: ds graphs are not updating... |
|
|
| seichimaru wrote: | hi,
im still having a hard time figuring out why does my ds graphs(interface traffic) are not updating although all my cg graphs(ping latency test) are working.
the logs says:
01/02/2008 03:26:32 PM - SPINE: Poller[0] Host[2] DS[10] WARNING: Result from SNMP not valid. Partial Result: ...
01/02/2008 03:26:32 PM - SPINE: Poller[0] Host[2] DS[10] WARNING: Result from SNMP not valid. Partial Result: ...
i already looked almost everywhere in this forum and i haven't found any possible problem associated with mine...am i the only one experiencing this?
i hope to hear from you guys soon...
jeff | This is, when I should have dropped in. You may reproduce this by deleting the working graphs along with their datasources. Then, please read second link of my signature to find the cause of this error.
Well, I do understand if you don't want to loose your graphs ...
Reinhard
|
|
| Back to top |
|
 |
Rael Cacti User
Joined: 05 Apr 2007 Posts: 128
|
Posted: Fri Jan 11, 2008 12:05 pm Post subject: |
|
|
| gandalf wrote: | Please post output of | Code: | | php -q add_tree.php --list-nodes --tree-id=200 | You may scratch confidential information
Reinhard |
Yea, still having issues.
add_tree.php --type=node --node-type=host --tree-id=264 --host-id=213 --host-group-style=1
Reports:
Added Node node-id: (266)
However when I go into cacti it doesn't show up.
Known Tree Nodes:
type id text
Host 266 eccas567.xxxxx.xxxx.com Graph Template
WTF?!
|
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12295 Location: Muenster, Germany
|
Posted: Mon Jan 14, 2008 12:32 pm Post subject: |
|
|
Rael, I removed some confidential data from your posting. Please run | Code: | | php -q add_tree.php --list-trees|grep 264 | Does tree 264 has a parent-tree?
Reinhard
|
|
| Back to top |
|
 |
seichimaru
Joined: 02 Jul 2007 Posts: 6
|
Posted: Wed Jan 16, 2008 2:28 am Post subject: Re: ds graphs are not updating... |
|
|
| gandalf wrote: | | seichimaru wrote: | hi,
im still having a hard time figuring out why does my ds graphs(interface traffic) are not updating although all my cg graphs(ping latency test) are working.
the logs says:
01/02/2008 03:26:32 PM - SPINE: Poller[0] Host[2] DS[10] WARNING: Result from SNMP not valid. Partial Result: ...
01/02/2008 03:26:32 PM - SPINE: Poller[0] Host[2] DS[10] WARNING: Result from SNMP not valid. Partial Result: ...
i already looked almost everywhere in this forum and i haven't found any possible problem associated with mine...am i the only one experiencing this?
i hope to hear from you guys soon...
jeff | This is, when I should have dropped in. You may reproduce this by deleting the working graphs along with their datasources. Then, please read second link of my signature to find the cause of this error.
Well, I do understand if you don't want to loose your graphs ...
Reinhard |
Sir Gandalf,
Good day!
I manage to resolve my issues with this partial results. I'll keep in my your suggestion and advice.
Thanks!
|
|
| Back to top |
|
 |
melanie_pfefer
Joined: 27 Feb 2008 Posts: 5
|
Posted: Wed Feb 27, 2008 4:57 pm Post subject: |
|
|
I downloaded the tool of this thread.
add_device.php gives an error:
./add_device.php 1 zeus zeus public 2 disable
Warning: include_once(/lib/utility.php): failed to open stream: No such file or directory in /home/cactiuser/add_device.php on line 13
Warning: include_once(): Failed opening '/lib/utility.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/cactiuser/add_device.php on line 13
Warning: include_once(/lib/api_data_source.php): failed to open stream: No such file or directory in /home/cactiuser/add_device.php on line 14
Warning: include_once(): Failed opening '/lib/api_data_source.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/cactiuser/add_device.php on line 14
Warning: include_once(/lib/api_graph.php): failed to open stream: No such file or directory in /home/cactiuser/add_device.php on line 15
Warning: include_once(): Failed opening '/lib/api_graph.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/cactiuser/add_device.php on line 15
Warning: include_once(/lib/snmp.php): failed to open stream: No such file or directory in /home/cactiuser/add_device.php on line 16
Warning: include_once(): Failed opening '/lib/snmp.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/cactiuser/add_device.php on line 16
Warning: include_once(/lib/data_query.php): failed to open stream: No such file or directory in /home/cactiuser/add_device.php on line 17
Warning: include_once(): Failed opening '/lib/data_query.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/cactiuser/add_device.php on line 17
Warning: include_once(/lib/api_device.php): failed to open stream: No such file or directory in /home/cactiuser/add_device.php on line 18
Warning: include_once(): Failed opening '/lib/api_device.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/cactiuser/add_device.php on line 18
Fatal error: Call to undefined function db_fetch_assoc() in /home/cactiuser/add_device.php on line 26
|
|
| Back to top |
|
 |
BSOD2600 Cacti Moderator
Joined: 08 May 2004 Posts: 6791 Location: WA, USA
|
Posted: Wed Feb 27, 2008 5:51 pm Post subject: |
|
|
| melanie_pfefer wrote: | I downloaded the tool of this thread.
add_device.php gives an error |
Why use this tool when the scripts in cacti 0.8.7.x do the majority of it now?
|
|
| Back to top |
|
 |
|