Cacti (home)ForumsDocumentation

configmanager

type:
userplugin
userplugin:
configmanager
author:
Jean-Michel Pepin
description:
interface between Cacti and scripts. Some scripts for configuration download and upload are delivered. The scripts could be started with a scheduler or via traps/syslog-traps. A tool for web-comparaison is included.
version:
0.826
pia:
2.x
cacti:
0.8.7e,0.8.7g
homepage:
http://forums.cacti.net/viewtopic.php?p=59773
date:
2010-08-23
subtype:
mapping
license:
GPLv2
plugins:
script,
control

Download

This plugin can be download here:

Purpose

Here is an plugin to be the interface between cacti and scripts (integrated scheduler for cacti). I created it for downloading automatically the modified switchs, uploading or for inventory A snmp trap or Syslog can start/active the predefined scripts. (with v0.825 and above all syslog DB could be used. By default syslog plugin)

Some example scripts are offered to backup or upload configuration of your devices. Some scripts are system specifics because Windows and Unix do not react in the same manner. For example ssh unix do not allow to pass password –> we create expect scripts

Why two methods. Originately it was created to make backup or changes of your devices with script or pancho or TFTP. Now the TFTP is become desapreciated because (above 0.9) because it could be integrated in method script. - method “script”:what you want of any devices type. - or method “TFTP” (will be depreciated) download or upload the configurations files of router,switches through TFTP this “TFTP method was based on pancho (www.pancho.org) or my sharednetworkclass (an extended and PHP version of pancho)

The method “script” uses your scripts or script-template (like ssh-ios-config, …)

With this pugin you can easily schedule several download or upload of configuration of your switches. If several configuration are schedule for the same time, only one will be immediatly executed, the other have to wait the next polling of cacti (5 Minutes). I choose this option because I don't want to overload the server. For the upload I fixed a max value (see in setting) because it could be very dangerous. You can change the default.

You have the possibility to choose to insert the routers or switches with the device list of mac_trac if this plugin is activated (click on “hostid?” or “mactracid?” checkbox). this option appears only if you have mactrac plugin.

You can choose for each config a post or pre command to be executed. You can reset the “last run” time direct from the first configmanager view in order to force to restart the download/upload in 5 minutes.

More description below.

Features

Script Method

With this method you can insert any command to execute on the selected devices.

A lot of scripts you can use (windows and unix) are delivered.

This method seems easy but it very powerful because you can now:

  • use any scripts
  • or use predefined script for example to download / upload a device configuration or information with Telnet, SCP, SSH, SFTP or your scripts or FTP ….

You can define your own functions template in the file “template.txt” (no reboot, only click again).

Some template are defined in template.txt. The help text of your template will be shown when you select your option and click on the help button.

The advantage is you need neither SNMP nor TFTP nor a external program. You can also do what you want. You can select a template, your script or direct insert your command in the parameter field of the configmanager.

Some parameters will be exchanged during the execution.

ParamenterDefinition
%i%will be replaced by the ip addresse of the device.
%n%name of the device listed in a configuration.
%d%day
%y%year
%m%month
%f%name of the config
%l%log file name
%s%full log file name.
%p%path
%u%user
%w%password
%g%path to configmanager plugins directory.

Comparison Tool

You can compare what you want its a diff. I tested only under windows at this time but it should also function under linux. For the Windows users I have put a diff.exe in the configmanager plugins which has the same parameters as under linux. For the compare (diff) function check it you have the following temporary folder

'./plugins/configmanager/temp'

TFTP Method

Depreciated method: will disapear above v0.9. Replace your configuration with “script”-method. Example will be provided in v0.82 and above “panchoconvert.sh”

  • You can use TFTP based on “Pancho” (www.pancho.org)
  • or use the TFTP pure PHP based on my sharednetwork class (don't need to install Pancho, but at this time only

tested for Foundry, Cisco, … but should function for nortel, …)

  • Download/upload with TFTP. In this method you have two possibilities.
    • Using additionally pancho (a perl program) or TFTP with PHP.
    • with pancho. Pancho is a perl library to download/upload the device configuration through TFTP independantly of the vendor. You need to install perl and pancho.
  • pure TFTP (PHP) method is using my PHP-sharednetworkclass. It does the same like pancho but with PHP and you only need to copy the files of sharednetworkclass in order to function.

pancho or the sharednetworkclass works with almost all types of router and switches (cisco,foundry,avaya, Nortel, acelar, and much more).

Prerequisites

P.A. 2.x

Installation

The realm is automatically found (It will try to use user_auth_realms 70 but take a other one if already used).

  • (if you had in old version) !!! Don't forget to save and copy again your scripts under “your_cacti/plugins/configmanager/scripts”.
  • (if you had an old version) remove or comment it in the “your_cacti/include/global.php” file

“$plugins[] = 'configmanager';”.

  1. copy the plugin under “your_cacti/plugins/configmanager”
    NO need to install the SQL (This Step will be done with “plugin install” in cacti)
  2. In cacti install and enable the configmanager in “Management Plugin” of Cacti.
  3. put the rights to use this plugin for your dedicated user. (In the cacti user administration tab)
  4. Authorization to web access:
    To reduce the access to only few workstation do the following step (Without secure.cfg file all IPs are allowed to this plugin): 
    create secure.cfg or copy secure.cfg.example to secure.cfg and adapt it. 
    give the rights to access to this plugin only for the managers workstations in plugins/configmanager/secure.cfg. 
    From the cacti server (127.0.0.1) you have always the rights to access it. 
    If you want any host insert a line with 'any host'. But pay attention ...
  5. (optional) reducing authorization to web access for showing the configuration: Change the setting “accessible path for diff”.
  6. For the compare (diff) function check it you have the following temporary folder './plugins/configmanager/temp'.
  7. check the setting in the settings tab “configmanager”.
    ex: accept trap “enable” or “disable” globally the start of scripts with TRAPs.
  8. (Windows Cacti). For the windows cacti without “diff” and “gzip”
    check if these programs are under “plugins/configmanager/” or if you have installed these programs with the environement variable path. If not download it from http://forums.cacti.net/about12406.html or or the http://cactiusers.org/forums/topic257.html
  9. (Unix Cacti) minimal rights
    chgrp www-data configmanager/temp                  (if www-data is your cacti apache user)
    chmod g+sw     configmanager/temp    
    chgrp www-data configmanager/cfgmng_logfile.txt    (if www-data is your cacti apache user)
    chmod g+sw     configmanager/cfgmng_logfile.txt
  10. create your configuration to schedule
  11. For the “script” method check if the file template.txt covers your needs or have a look to the predefined scripts. (please if you have good ideas, new templates tell us that)
  12. if you want to use the trap events in order to reexecute configmanager-script for the host which has sent a trap. Configure configmanager_trap_list.txt eiter directly or from view “trap events” in order to give which traps are starting an event. In setting check the “accept traps” and active the delay to wait before your “configmanager-script” will be started. For each “configmanager-script”, that have to start again for the host with trap, check “accept events”.
  13. TFTP method is depreciated. Please use “script” method instead. Some example will be created
  14. (depreciated) (optional TFTP method) Only If you want to use the “TFTP” method with Pancho. Install “pancho” www.pancho.org (with perl!!). otherwise use the option pure PHP.
  15. (depreciated) (optional TFTP method) If you want to use the “TFTP” method with pure PHP you have to install (copy) the sharednetwork class (for example under plugins\sharednetworkclass). If you don't copy it into plugins\sharednetworkclass you have to change the path in config.php.
  16. (depreciated) (optional TFTP method) insert/change in the settings tab: Only If you want to use the “TFTP” method
    1. TFTP server (name or IP)
    2. TFTP root data path
    3. program (please with the full name if cactid and if you prefer the pancho library use the ”-Id:/programme/pancho/lib” parameter like me)
      (ex: D:/Programme/perl/bin/perl.exe -Id:/programme/pancho/lib d:/programme/pancho/pancho.pl)

Usage

Additional Help?

If you need additional help, please go to

Possible Bugs?

History

2007-2010

  • adapt to PA 2.x Plugin Architecture.
  • in main menu first the action “reset in 5 minutes”, second “delete”.
  • Sort-function in the views
  • ignore the disabled devices.
  • allow the possiblity to authorize any remote hosts to access to this plugin,
  • in this case only the cacti authetification is needed (I don't like but some people want it).
  • add some information in the views + aivability to sort in the list.
  • compare module amelioration (+ new parameter in settings).

2007

  • add of binary upload/download param for Nortel+Passport

2007?

  • integration of TFTP method pure PHP (sharednetworkclass)

2006

  • add the compare “diff” function

2004

Screenshots






Personal Tools