i am using the latest version... what is the name of the script?gandalf wrote:Please use the cli scripts provided by cacti since 087
Reinhard
Quick and dirty script to add devices to cacti
Moderators: Developers, Moderators
what script?
dont see that folder
TheBigOne wrote:I think you should use the cli scripts /var/www/html/cacti/cli/
You will find a howto in the cacti documentation and a help if you run the script with -h
I don't have a folder named /cli under the cacti directory. I am running the latest cacti version.
[xxxxxx@localhost cacti]$ ls -la
total 1620
drwxr-xr-x 11 root root 4096 2008-11-18 23:13 .
drwxr-xr-x 271 root root 12288 2008-11-20 14:36 ..
-rw-r--r-- 1 root root 6387 2008-02-14 09:39 about.php
-rw-r--r-- 1 root root 4703 2008-11-13 15:35 auth_changepassword.php
-rw-r--r-- 1 root root 531 2008-11-13 16:03 auth_changepassword.php.rej
-rw-r--r-- 1 root root 11868 2008-11-13 15:35 auth_login.php
-rw-r--r-- 1 root root 1762 2008-11-13 16:03 auth_login.php.rej
-rw-r--r-- 1 root root 85470 2008-11-13 16:03 cacti-plugin-0.8.7b-PA-v2.1.diff
drwxr-xr-x 3 root root 4096 2008-11-13 15:34 cacti-plugin-arch
-rw-r--r-- 1 root root 173327 2008-03-22 23:47 cacti-plugin-arch.tar.gz
drwxr-xr-x 6 root root 4096 2008-11-13 13:16 cacti-spine-0.8.7a
-rw-r--r-- 1 root root 364746 2007-11-25 22:40 cacti-spine-0.8.7a.tar.gz
-rw-r--r-- 1 root root 124294 2008-11-07 15:31 cacti.sql
-rw-r--r-- 1 root root 12960 2008-02-14 09:39 cdef.php
-rwxr-xr-x 1 root root 18369 2008-02-14 09:39 cmd.php
-rw-r--r-- 1 root root 5765 2008-02-14 09:39 color.php
drwxr-xr-x 2 777 root 4096 2008-11-13 16:45 conifg_backups
-rw-r--r-- 1 root root 23279 2008-02-14 09:39 data_input.php
-rw-r--r-- 1 root root 33923 2008-02-14 09:39 data_queries.php
-rw-r--r-- 1 root root 49345 2008-11-13 15:35 data_sources.php
-rw-r--r-- 1 root root 1120 2008-11-13 16:03 data_sources.php.rej
-rw-r--r-- 1 root root 31304 2008-02-14 09:39 data_templates.php
-rw-r--r-- 1 root root 5958 2008-02-14 09:39 gprint_presets.php
-rw-r--r-- 1 root root 3446 2008-11-13 15:35 graph_image.php
-rw-r--r-- 1 root root 312 2008-11-13 16:03 graph_image.php.rej
-rw-r--r-- 1 root root 12106 2008-11-13 15:35 graph.php
-rw-r--r-- 1 root root 5602 2008-11-13 16:03 graph.php.rej
-rw-r--r-- 1 root root 7716 2008-02-14 09:39 graph_settings.php
-rw-r--r-- 1 root root 13828 2008-02-14 09:39 graphs_items.php
-rw-r--r-- 1 root root 37183 2008-11-13 15:35 graphs_new.php
-rw-r--r-- 1 root root 928 2008-11-13 16:03 graphs_new.php.rej
-rw-r--r-- 1 root root 50907 2008-11-13 15:35 graphs.php
-rw-r--r-- 1 root root 1489 2008-11-13 16:03 graphs.php.rej
-rw-r--r-- 1 root root 9945 2008-02-14 09:39 graph_templates_inputs.php
-rw-r--r-- 1 root root 18482 2008-02-14 09:39 graph_templates_items.php
-rw-r--r-- 1 root root 25042 2008-02-14 09:39 graph_templates.php
-rw-r--r-- 1 root root 29052 2008-02-14 09:39 graph_view.php
-rw-r--r-- 1 root root 5758 2008-02-14 09:39 graph_xport.php
-rw-r--r-- 1 root root 50696 2008-11-13 15:35 host.php
-rw-r--r-- 1 root root 2284 2008-11-13 16:03 host.php.rej
-rw-r--r-- 1 root root 18045 2008-02-14 09:39 host_templates.php
drwxr-xr-x 2 root root 4096 2008-11-07 14:56 images
drwxr-xr-x 5 root root 4096 2008-11-18 16:12 include
-rw-r--r-- 1 root root 2313 2008-11-13 15:36 index.php
-rw-r--r-- 1 root root 551 2008-11-13 16:03 index.php.rej
drwxr-xr-x 2 root root 4096 2008-11-07 14:56 install
drwxr-xr-x 3 root root 4096 2008-11-13 16:03 lib
lrwxrwxrwx 1 root root 15 2008-11-07 14:56 log -> /var/log/cacti/
-rw-r--r-- 1 root root 2451 2008-02-14 09:39 logout.php
drwxrwxrwx 15 777 root 4096 2008-11-14 14:17 plugins
-rw-r--r-- 1 root root 14967 2008-11-13 15:36 plugins.php
-rw-r--r-- 1 root root 15813 2008-11-13 16:03 plugins.php.rej
-rw-r--r-- 1 root root 4306 2008-02-14 09:39 poller_commands.php
-rw-r--r-- 1 root root 2243 2008-02-14 09:39 poller_export.php
-rwxr-xr-x 1 root root 15178 2008-11-13 15:36 poller.php
-rw-r--r-- 1 root root 2322 2008-11-13 16:03 poller.php.rej
drwxr-xr-x 5 root root 4096 2008-11-07 14:56 resource
lrwxrwxrwx 1 root root 18 2008-11-07 14:56 rra -> /var/lib/cacti/rra
-rw-r--r-- 1 root root 7084 2008-02-14 09:39 rra.php
lrwxrwxrwx 1 root root 22 2008-11-07 14:56 scripts -> /var/lib/cacti/scripts
-rw-r--r-- 1 root root 7304 2008-02-14 09:39 script_server.php
-rw-r--r-- 1 root root 4996 2008-02-14 09:39 settings.php
-rw-r--r-- 1 root root 6667 2008-02-14 09:39 templates_export.php
-rw-r--r-- 1 root root 6524 2008-02-14 09:39 templates_import.php
-rw-r--r-- 1 root root 17835 2008-02-14 09:39 tree.php
-rw-r--r-- 1 root root 42240 2008-11-13 15:36 user_admin.php
-rw-r--r-- 1 root root 3830 2008-11-13 16:03 user_admin.php.rej
-rw-r--r-- 1 root root 48973 2008-11-13 15:36 utilities.php
-rw-r--r-- 1 root root 733 2008-11-13 16:03 utilities.php.rej
in cacti 0.8.7b still some rows are not indexed so it can take up to 25 minutes to add a host from cli whithout indexing anyway here is a script that I use to add cisco devices to cacti, just copy the script to cli/ dir, modify it to suit your needs and run it like this cisco.pl device_name device_ip
- Attachments
-
- cisco.pl
- (15.65 KiB) Downloaded 528 times
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Any hints on indexes required?timi wrote:in cacti 0.8.7b still some rows are not indexed so it can take up to 25 minutes to add a host from cli whithout indexing anyway here is a script that I use to add cisco devices to cacti, just copy the script to cli/ dir, modify it to suit your needs and run it like this cisco.pl device_name device_ip
Reinhard
based on the selects found on the scripts I modified :gandalf wrote:Any hints on indexes required?timi wrote:in cacti 0.8.7b still some rows are not indexed so it can take up to 25 minutes to add a host from cli whithout indexing anyway here is a script that I use to add cisco devices to cacti, just copy the script to cli/ dir, modify it to suit your needs and run it like this cisco.pl device_name device_ip
Reinhard
table data_input_fields
Code: Select all
...
PRIMARY KEY (`id`),
KEY `data_input_id` (`data_input_id`),
KEY `input_output` (`input_output`),
KEY `type_code` (`type_code`),
KEY `name` (`name`),
KEY `data_name` (`data_name`)
...
Code: Select all
...
PRIMARY KEY (`data_input_field_id`,`data_template_data_id`),
KEY `t_value` (`t_value`)
...
Code: Select all
...
PRIMARY KEY (`snmp_query_graph_id`,`data_template_id`,`data_template_rrd_id`),
KEY `snmp_query_graph_id` (`snmp_query_graph_id`),
KEY `snmp_field_name` (`snmp_field_name`)
...
Code: Select all
...
PRIMARY KEY (`id`),
KEY `graph_template_id` (`graph_template_id`),
KEY `local_graph_id` (`local_graph_id`),
KEY `task_item_id` (`task_item_id`)
...
Code: Select all
...
PRIMARY KEY (`id`),
KEY `local_data_id` (`local_data_id`),
KEY `data_template_id` (`data_template_id`),
KEY `name` (`name`),
KEY `data_source_path` (`data_source_path`)
...
I have the same problems adding devices.
It is hard to debug but i found a bit.
http://forums.cacti.net/viewtopic.php?t ... highlight=
BUT i still dont know how to fix it.
It is hard to debug but i found a bit.
http://forums.cacti.net/viewtopic.php?t ... highlight=
BUT i still dont know how to fix it.
Hello guys,
Well firstable I had to say that this post is very interesting and high skill also.
I'm not a fan on scripting and Stuff like that, so congrats for this work !
I would likle to know if someone of you guys could make a brief sumup on the requirements and what to do to sucessfully implement devices, graphs tree etc... Because having ridden this post its pretty difficult to have a Quick "how to" overview.
I have a 0.8.7b version.
Thx by advance for your help and sorry for mistakes... My written English is not so perfect!
Well firstable I had to say that this post is very interesting and high skill also.
I'm not a fan on scripting and Stuff like that, so congrats for this work !
I would likle to know if someone of you guys could make a brief sumup on the requirements and what to do to sucessfully implement devices, graphs tree etc... Because having ridden this post its pretty difficult to have a Quick "how to" overview.
I have a 0.8.7b version.
Thx by advance for your help and sorry for mistakes... My written English is not so perfect!
-
- Posts: 20
- Joined: Thu Aug 20, 2009 7:41 am
Hi All,
can some body tell me whether any variable need to be set beause am using latest cacti . is there any change in config files?
[root@localhost cacti]# php add_device.php
PHP Notice: Undefined variable: config in /var/www/htdocs/cacti/add_device.php on line 13
PHP Warning: include_once(/lib/utility.php): failed to open stream: No such file or directory in /var/www/htdocs/cacti/add_device.php on line 13
PHP Warning: include_once(): Failed opening '/lib/utility.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/htdocs/cacti/add_device.php on line 13
PHP Notice: Undefined variable: config in /var/www/htdocs/cacti/add_device.php on line 14
PHP Warning: include_once(/lib/api_data_source.php): failed to open stream: No such file or directory in /var/www/htdocs/cacti/add_device.php on line 14
PHP Warning: include_once(): Failed opening '/lib/api_data_source.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/htdocs/cacti/add_device.php on line 14
PHP Notice: Undefined variable: config in /var/www/htdocs/cacti/add_device.php on line 15
PHP Warning: include_once(/lib/api_graph.php): failed to open stream: No such file or directory in /var/www/htdocs/cacti/add_device.php on line 15
PHP Warning: include_once(): Failed opening '/lib/api_graph.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/htdocs/cacti/add_device.php on line 15
PHP Notice: Undefined variable: config in /var/www/htdocs/cacti/add_device.php on line 16
PHP Warning: include_once(/lib/snmp.php): failed to open stream: No such file or directory in /var/www/htdocs/cacti/add_device.php on line 16
PHP Warning: include_once(): Failed opening '/lib/snmp.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/htdocs/cacti/add_device.php on line 16
PHP Notice: Undefined variable: config in /var/www/htdocs/cacti/add_device.php on line 17
PHP Warning: include_once(/lib/data_query.php): failed to open stream: No such file or directory in /var/www/htdocs/cacti/add_device.php on line 17
PHP Warning: include_once(): Failed opening '/lib/data_query.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/htdocs/cacti/add_device.php on line 17
PHP Notice: Undefined variable: config in /var/www/htdocs/cacti/add_device.php on line 18
PHP Warning: include_once(/lib/api_device.php): failed to open stream: No such file or directory in /var/www/htdocs/cacti/add_device.php on line 18
PHP Warning: include_once(): Failed opening '/lib/api_device.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/htdocs/cacti/add_device.php on line 18
Usage:
add_device.php templateid description IP snmp_community snmp_version disable
Where:
- templateid is a number (read below to get a list of templates)
- description: the name that will be displayed by Cacti in the graphs
- IP: self explanatory (can also be a FQDN)
- snmp_community: community string
- snmp_version: 1/2
- disable: 1 to add this host but to disable checks and 0 to enable it
can some body tell me whether any variable need to be set beause am using latest cacti . is there any change in config files?
[root@localhost cacti]# php add_device.php
PHP Notice: Undefined variable: config in /var/www/htdocs/cacti/add_device.php on line 13
PHP Warning: include_once(/lib/utility.php): failed to open stream: No such file or directory in /var/www/htdocs/cacti/add_device.php on line 13
PHP Warning: include_once(): Failed opening '/lib/utility.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/htdocs/cacti/add_device.php on line 13
PHP Notice: Undefined variable: config in /var/www/htdocs/cacti/add_device.php on line 14
PHP Warning: include_once(/lib/api_data_source.php): failed to open stream: No such file or directory in /var/www/htdocs/cacti/add_device.php on line 14
PHP Warning: include_once(): Failed opening '/lib/api_data_source.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/htdocs/cacti/add_device.php on line 14
PHP Notice: Undefined variable: config in /var/www/htdocs/cacti/add_device.php on line 15
PHP Warning: include_once(/lib/api_graph.php): failed to open stream: No such file or directory in /var/www/htdocs/cacti/add_device.php on line 15
PHP Warning: include_once(): Failed opening '/lib/api_graph.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/htdocs/cacti/add_device.php on line 15
PHP Notice: Undefined variable: config in /var/www/htdocs/cacti/add_device.php on line 16
PHP Warning: include_once(/lib/snmp.php): failed to open stream: No such file or directory in /var/www/htdocs/cacti/add_device.php on line 16
PHP Warning: include_once(): Failed opening '/lib/snmp.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/htdocs/cacti/add_device.php on line 16
PHP Notice: Undefined variable: config in /var/www/htdocs/cacti/add_device.php on line 17
PHP Warning: include_once(/lib/data_query.php): failed to open stream: No such file or directory in /var/www/htdocs/cacti/add_device.php on line 17
PHP Warning: include_once(): Failed opening '/lib/data_query.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/htdocs/cacti/add_device.php on line 17
PHP Notice: Undefined variable: config in /var/www/htdocs/cacti/add_device.php on line 18
PHP Warning: include_once(/lib/api_device.php): failed to open stream: No such file or directory in /var/www/htdocs/cacti/add_device.php on line 18
PHP Warning: include_once(): Failed opening '/lib/api_device.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/htdocs/cacti/add_device.php on line 18
Usage:
add_device.php templateid description IP snmp_community snmp_version disable
Where:
- templateid is a number (read below to get a list of templates)
- description: the name that will be displayed by Cacti in the graphs
- IP: self explanatory (can also be a FQDN)
- snmp_community: community string
- snmp_version: 1/2
- disable: 1 to add this host but to disable checks and 0 to enable it
--SanG
-
- Posts: 20
- Joined: Thu Aug 20, 2009 7:41 am
Who is online
Users browsing this forum: No registered users and 2 guests