Configmanager

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
User avatar
brononi
Cacti User
Posts: 123
Joined: Tue Aug 29, 2006 1:58 am
Location: Belgium
Contact:

Configmanager

Post by brononi »

Hey,

I'm playing around with the configmanager. But can't figure out how (what) i need to do to take a backup.
I create a group, and add my devices in there. In the logfile, i see that the scripts are running, but i can't find any results.

Does anyone knows which script i must use to backup a standard cisco switch/router (running config)?

Or how i can put the logs in a higher level so i can see more of the results? Today, only a line with script runs is in there (see below some tries)...

2011-03-10 15:17:12 CFG MANAGER: DEBUG: exec_background(scp ronsse@15.0.0.1:flash:/config.text /data/15.0.0.1scp.txt) for following hosts:15.0.0.1

2011-03-10 15:17:11 CFG MANAGER: INFO: execute Script method configuration 3 (PreProd).

2011-03-10 15:15:12 CFG MANAGER: DEBUG: exec_background(/var/www/html/plugins/configmanager/configmanager/scripts/telnetdownloadunix.sh 15.0.0.1 ronsse *** /var/depot/15.0.0.1.cfg 4) for following hosts:15.0.0.1

2011-03-10 15:15:11 CFG MANAGER: INFO: execute Script method configuration 3 (PreProd).

2011-03-10 15:14:13 CFG MANAGER: DEBUG: exec_background(/var/www/html/plugins/configmanager/scripts/telnetdownloadcygwin.bat 15.0.0.1 ronsse *** /data/20110310/15.0.0.1.cfg 10) for following hosts:15.0.0.1

2011-03-10 15:14:12 CFG MANAGER: INFO: execute Script method configuration 3 (PreProd).

2011-03-10 15:12:12 CFG MANAGER: DEBUG: exec_background(/var/www/html/plugins/configmanager/scripts/ssh-ios-config.sh ronsse *** 15.0.0.1 /var/www/html/plugins/configmanager/cfgmng_logfile.txt /var/www/html/plugins/configmanager/temp/data/20110310/15.0.0.1.txt show run) for following hosts:15.0.0.1
  • Cacti: 0.8.8f / Plugin Architecture Version: 3.1 / Linuxbased
  • Third Party: Apache 2.4.12 / PHP 5.6.11 / NET-SNMP version 5.3.2.2 / RRDTool 1.5.4
  • Plugins: Configmanager 0.826 / Aggregate 0.70B2 / Manage 0.6.2 / Weathermap 0.97a / Thold 0.4.9 / Quicktree 0.2 / Realtime 0.5 / Settings 0.7
  • Data:Host 1341 / Graphs 6752
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

Re: Configmanager

Post by pepj »

brononi wrote:Hey,
I'm playing around with the configmanager. But can't figure out how (what) i need to do to take a backup.
I create a group, and add my devices in there. In the logfile, i see that the scripts are running, but i can't find any results.
Does anyone knows which script i must use to backup a standard cisco switch/router (running config)?
Or how i can put the logs in a higher level so i can see more of the results? Today, only a line with script runs is in there (see below some tries)...
First answer:
which system you have (linux, windows)?
do you have ssh on the switchs?

with linux and ssh on the switchs 'sh-ios-config.sh' function well. Notice1: you have to install expect. notice2: if you do not allow (default linux) the allowed key could change and you exchange a switch with an other, the script will send a event to the syslog because the administrator must removed the old key. You can activate a e-mail if the syslog receive such warning.

PS: you can start/test also manually these scripts.
Jean-Michel
cacti 0.8.7e | cmd & cactid (cactid 0.8.x) | Linux | MySQL Ver 14.7 Distrib 4.1.12, for Win32 | PHP v5.2.6 | Apache v2.x | Thold | Plugin Architecture | plugin "configuration manager" http://cactiusers.org/forums/topic257.html | plugin "IP subnet calculator IPv4 / IPV6" http://forums.cacti.net/viewtopic.php?t=15428 | plugin banner http://docs.cacti.net/userplugin:banner | Net-SNMP 5.5.2 | cygwin 1.5.18 of 02.07.2005
User avatar
brononi
Cacti User
Posts: 123
Joined: Tue Aug 29, 2006 1:58 am
Location: Belgium
Contact:

Re: Configmanager

Post by brononi »

Hey,

It's a linux machine, and i'm able to connect from the machine with ssh towards the routers.
I've just installed expect. This wasn't installed. So i did this with 'yum install expect'.



What's the manual way to test these scripts? :$


Some details of the logs:
2011-03-15 13:50:59 CFG MANAGER: Update setting to sql db (import syslog host,import syslog user,import syslog pwd) -> result=ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,

2011-03-15 13:50:18 CFG MANAGER: DEBUG: exec_background(/var/www/html/plugins/configmanager/scripts/ssh-ios-config.sh username *** 10.128.146.254 /var/www/html/plugins/configmanager/cfgmng_logfile.txt /var/www/html/plugins/configmanager/temp/data/20110315/10.128.146.254.txt show run) for following hosts:10.128.146.254

/var/www/html/plugins/configmanager/scripts/ssh-ios-config.sh: line 3: /var/www/html/plugins/configmanager/temp/data/20110315/10.128.146.254.txt: No such file or directory

/var/www/html/plugins/configmanager/scripts/ssh-ios-config.exp username %4 %4 %5cfgmng_logfile.txt %5cfgmng_logfile.txt %6cfgmng_logfile.txt LICENSE README about.php auth_changepassword.php auth_login.php auth_login.username auth_login.wrong cacti.sql cdef.php cli cmd.php color.php configs data_input.php data_queries.php data_sources.php data_templates.php docs gprint_presets.php graph.php graph_image.php graph_settings.php graph_templates.php graph_templates_inputs.php graph_templates_items.php graph_view.php graph_xport.php graphs.php graphs_items.php graphs_new.php host.php host_templates.php images include index.php install ioncube lib log logout.php phpmyadmin plugins plugins.php poller.php poller_commands.php poller_export.php resource rra rra.php run script_server.php script_server.pl scripts settings.php show templates_export.php templates_import.php tree.php user_admin.php utilities.php 10.128.146.254 show run

2011-03-15 13:50:17 CFG MANAGER: DEBUG: exec_background(/var/www/html/plugins/configmanager/scripts/ssh-ios-config.sh username *** 10.128.140.254 /var/www/html/plugins/configmanager/cfgmng_logfile.txt /var/www/html/plugins/configmanager/temp/data/20110315/10.128.140.254.txt show run) for following hosts:10.128.140.254

/var/www/html/plugins/configmanager/scripts/ssh-ios-config.sh: line 3: /var/www/html/plugins/configmanager/temp/data/20110315/10.128.140.254.txt: No such file or directory

/var/www/html/plugins/configmanager/scripts/ssh-ios-config.exp username %4 %4 %5cfgmng_logfile.txt %5cfgmng_logfile.txt %6cfgmng_logfile.txt LICENSE README about.php auth_changepassword.php auth_login.php auth_login.username auth_login.wrong cacti.sql cdef.php cli cmd.php color.php configs data_input.php data_queries.php data_sources.php data_templates.php docs gprint_presets.php graph.php graph_image.php graph_settings.php graph_templates.php graph_templates_inputs.php graph_templates_items.php graph_view.php graph_xport.php graphs.php graphs_items.php graphs_new.php host.php host_templates.php images include index.php install ioncube lib log logout.php phpmyadmin plugins plugins.php poller.php poller_commands.php poller_export.php resource rra rra.php run script_server.php script_server.pl scripts settings.php show templates_export.php templates_import.php tree.php user_admin.php utilities.php 10.128.140.254 show run

2011-03-15 13:50:16 CFG MANAGER: DEBUG: exec_background(/var/www/html/plugins/configmanager/scripts/ssh-ios-config.sh username *** 10.128.138.254 /var/www/html/plugins/configmanager/cfgmng_logfile.txt /var/www/html/plugins/configmanager/temp/data/20110315/10.128.138.254.txt show run) for following hosts:10.128.138.254
Last edited by brononi on Tue Mar 15, 2011 8:11 am, edited 1 time in total.
  • Cacti: 0.8.8f / Plugin Architecture Version: 3.1 / Linuxbased
  • Third Party: Apache 2.4.12 / PHP 5.6.11 / NET-SNMP version 5.3.2.2 / RRDTool 1.5.4
  • Plugins: Configmanager 0.826 / Aggregate 0.70B2 / Manage 0.6.2 / Weathermap 0.97a / Thold 0.4.9 / Quicktree 0.2 / Realtime 0.5 / Settings 0.7
  • Data:Host 1341 / Graphs 6752
User avatar
brononi
Cacti User
Posts: 123
Joined: Tue Aug 29, 2006 1:58 am
Location: Belgium
Contact:

Re: Configmanager

Post by brononi »

When i see this log (cfgmng_logfile.txt), i've got the impression that the destination files aren't there (or aren't created)?

Also, when i check our firewall logs, i don't see any traffic passing by. When i do a ssh connection towards this, i see it. So i suppose the application (script) isn't starting the connection...

Code: Select all

15/03/2011 14:06:11 CFG MANAGER: INFO: Database synchronisation. result=OK for UPDATE plugin_cfgmng_data,host  SET plugin_cfgmng_data.hostname=host.hostname WHERE ((plugin_cfgmng_data.hostid>0) AND (plugin_cfgmng_data.configmanagerid=3)        AND (plugin_cfgmng_data.hostid=host.id)); 

15/03/2011 14:06:11 CFG MANAGER: INFO: Database synchronisation. result=OK for UPDATE plugin_cfgmng_data SET hostip='10.128.140.254' WHERE (configmanagerid=3) AND (hostname='10.128.140.254');

2011-03-15 14:06:11 CFG MANAGER: INFO: execute Script method configuration 3 (PreProd).

2011-03-15 14:06:11 CFG MANAGER: DEBUG: createconfig for PreProd(configid=3)!
 LICENSE README about.php auth_changepassword.php auth_login.php auth_login.username auth_login.wrong cacti.sql cdef.php cli cmd.php color.php configs data_input.php data_queries.php data_sources.php data_templates.php docs gprint_presets.php graph.php graph_image.php graph_settings.php graph_templates.php graph_templates_inputs.php graph_templates_items.php graph_view.php graph_xport.php graphs.php graphs_items.php graphs_new.php host.php host_templates.php images include index.php install ioncube lib log logout.php phpmyadmin plugins plugins.php poller.php poller_commands.php poller_export.php resource rra rra.php run script_server.php script_server.pl scripts settings.php show templates_export.php templates_import.php tree.php user_admin.php utilities.php 10.128.140.254 show run
/var/www/html/plugins/configmanager/scripts/ssh-ios-config.sh: line 3: /var/www/html/plugins/configmanager/data/20110315/10.128.140.254.txt: No such file or directory

2011-03-15 14:06:12 CFG MANAGER: DEBUG: exec_background(/var/www/html/plugins/configmanager/scripts/ssh-ios-config.sh username *** 10.128.140.254 /var/www/html/plugins/configmanager/cfgmng_logfile.txt /var/www/html/plugins/configmanager/data/20110315/10.128.140.254.txt show run)  for following hosts:10.128.140.254
  • Cacti: 0.8.8f / Plugin Architecture Version: 3.1 / Linuxbased
  • Third Party: Apache 2.4.12 / PHP 5.6.11 / NET-SNMP version 5.3.2.2 / RRDTool 1.5.4
  • Plugins: Configmanager 0.826 / Aggregate 0.70B2 / Manage 0.6.2 / Weathermap 0.97a / Thold 0.4.9 / Quicktree 0.2 / Realtime 0.5 / Settings 0.7
  • Data:Host 1341 / Graphs 6752
User avatar
brononi
Cacti User
Posts: 123
Joined: Tue Aug 29, 2006 1:58 am
Location: Belgium
Contact:

Re: Configmanager

Post by brononi »

Okay,

When i created the file myself (and chmod 777 on it), the backup is taken properly.
After going a bit more in depth, he can create the files, but not the directories (dateformat).

When i change the script a bit (remove the / between the date & hostname), it works:
  • %g%/scripts/ssh-ios-config.sh %u% %w% %n% %g%/cfgmng_logfile.txt %g%/temp/data/%y%%m%%d%%n%.txt show run

Next step, figuring out to tell him that he can create the directory himself... ;)
  • Cacti: 0.8.8f / Plugin Architecture Version: 3.1 / Linuxbased
  • Third Party: Apache 2.4.12 / PHP 5.6.11 / NET-SNMP version 5.3.2.2 / RRDTool 1.5.4
  • Plugins: Configmanager 0.826 / Aggregate 0.70B2 / Manage 0.6.2 / Weathermap 0.97a / Thold 0.4.9 / Quicktree 0.2 / Realtime 0.5 / Settings 0.7
  • Data:Host 1341 / Graphs 6752
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

Re: Configmanager

Post by pepj »

brononi wrote:Okay,
When i created the file myself (and chmod 777 on it), the backup is taken properly.
After going a bit more in depth, he can create the files, but not the directories (dateformat).
When i change the script a bit (remove the / between the date & hostname), it works:
  • %g%/scripts/ssh-ios-config.sh %u% %w% %n% %g%/cfgmng_logfile.txt %g%/temp/data/%y%%m%%d%%n%.txt show run
Next step, figuring out to tell him that he can create the directory himself... ;)
Do you have fill up the parameters of the config of configmanager

insert for example in the parameter "pre command":

Code: Select all

[ ! -d /yourpath/%y%%m%%d% ] && mkdir /yourpath/%y%%m%%d%
Naturally your user must have enough rights for the folder /yourpath/
Jean-Michel
cacti 0.8.7e | cmd & cactid (cactid 0.8.x) | Linux | MySQL Ver 14.7 Distrib 4.1.12, for Win32 | PHP v5.2.6 | Apache v2.x | Thold | Plugin Architecture | plugin "configuration manager" http://cactiusers.org/forums/topic257.html | plugin "IP subnet calculator IPv4 / IPV6" http://forums.cacti.net/viewtopic.php?t=15428 | plugin banner http://docs.cacti.net/userplugin:banner | Net-SNMP 5.5.2 | cygwin 1.5.18 of 02.07.2005
User avatar
brononi
Cacti User
Posts: 123
Joined: Tue Aug 29, 2006 1:58 am
Location: Belgium
Contact:

Re: Configmanager

Post by brononi »

pepj wrote:insert for example in the parameter "pre command":

Code: Select all

[ ! -d /yourpath/%y%%m%%d% ] && mkdir /yourpath/%y%%m%%d%
Great, is working perfectly like this...


Thanks a lot !!!
  • Cacti: 0.8.8f / Plugin Architecture Version: 3.1 / Linuxbased
  • Third Party: Apache 2.4.12 / PHP 5.6.11 / NET-SNMP version 5.3.2.2 / RRDTool 1.5.4
  • Plugins: Configmanager 0.826 / Aggregate 0.70B2 / Manage 0.6.2 / Weathermap 0.97a / Thold 0.4.9 / Quicktree 0.2 / Realtime 0.5 / Settings 0.7
  • Data:Host 1341 / Graphs 6752
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest