plugin for download/upload routers switches configuration

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

Re: how can i check if the view for version 2 allow...?

Post by pepj »

fernandakp wrote: DEBUG: HOST:10.71.8.1 RESULT:Error: function in developpement .......n
A/ (your 1/) It looks that the SysObjectID don't give back a cisco vendor oid (beginning with 1.3.6.1.4.1.9 ...)
With m=1 it should give the same answer as with net-snmp ( m=2 )
snmpget -v 1 -c rw-string IP-address .1.3.6.1.2.1.1.2.0
or
snmpget -v 1 -c rw-string IP-address SysObjectID
You should get : 1.3.6.1.4.1.9.1.620
Add line 162 of example8_tftp_snmp_networkclass.php and try again with m=1 (I would like to understand)

Code: Select all

            if ($debug!=0) print "vendor class used is ".$odevice->vendor."(oid=".$odevice->oiddevice.")\n";
fernandakp wrote: 2) .... how i can set this config by cacti schedule in config manager? I tried but i dont find any settings about this type of method used by pure TFTP.
B/
- check if you have in the global setting "path" of cacti snmpwalk Binary Path, snmpwalk binary path, snmpget Binary Path, snmpbulkwalk Binary Path, snmpgetnext Binary Path
- in the global setting "Up/Download Config Manager"
check "use netsnmp"
give the snmpsetname (without path, it will use the same path as cacti snmpget)
- that is finish to active net-snmp

C/ Cisco 1841 is used where you need security. Don't you want to use the method "multi" to save the config with SCP or SSH instead the unsecure TFTP ?
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
fernandakp
Posts: 27
Joined: Thu Jun 21, 2007 9:30 am

Re: how can i check if the view for version 2 allow...?

Post by fernandakp »

Pepj,
I tested the commands in A/ and the results are showed next:

# snmpget -v 1 -c private 10.171.173.2 .1.3.6.1.2.1.1.2.0
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.9.1.620

# snmpget -v 1 -c private 10.171.173.2 SysObjectID
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: SNMPv2-MIB::sysObjectID

I tested the example8 with the modifications you advised here:

# php example8_tftp_snmp_networkclass.php -d=1 -l=1 -m=1 -v=1 -c=private -i=10.171.173.2 --tftpserver=10.61.5.145 --tftpdirection=download --filesource=run --filedestination=configfile4.txt --path=/usr/bin
initialisation:OK
show the sysDescr
Found data query XML file at './MIBXML/MIBtoLoad.xml'
sysDescr-> result=Cisco IOS Software, 1841 Software (C1841-ADVSECURITYK9-M), Version 12.4(1a), RELEASE SOFTWARE (fc2) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2005 by Cisco Systems, Inc. Compiled Fri 27-May-05 12:32 by hqluong
vendor class used is default(oid=SNMPv2-SMI::enterprises.9.1.620)
parameter passed to the classArray
(
[startup] => 0
[source] => download
[tftpip] => 10.61.5.145
[filesrc] => run
[filedest] => configfile4.txt
[binary] => 0
)

DEBUG: HOST:10.71.8.1 RESULT:Error: function in developpement .......n


pepj wrote: C/ Cisco 1841 is used where you need security. Don t you want to use the method "multi" to save the config with SCP or SSH instead the unsecure TFTP ?
I couldn t make it work neither.
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

Re: how can i check if the view for version 2 allow...?

Post by pepj »

fernandakp wrote:I couldn t make it work neither.
Here again.....

I don't understand why you have not the same answer with and without NetSNMP, perhaps the MIBS settings.

1 solution/ You said it is working with Net-SNMP and example8_tftp_snmp_networkclass.php (option m=2)
So you can active "configmanager" with pure PHP and Net-SNMP
a) adapt the path to sharednetworkclasspath in config.php from configmanager plugin
b) in "configuration setting-->path" of cacti check all the snmp "Binary Path"
c) in "configuration setting-->Up/Download Config Manager" of cacti. change the "configmanager Settings used for TFTP shared class": active
"use netsnmp" and give the "snmpset name" (without path)
d) in the up/download configuration select the parameter "pure tftp without pancho"
e) try a "reset last run time" for this config in order to see if it is functioning

2 solution/ other solution using configmanager and method "multi" and for example SCP
a) what is your system (unix,windows) ???
b) create a config with method "multi" and choose for example the template "scp-cisco-ios-running-putty-windows" for windows or write you command in the command field.
c) For Cisco be sure for SSH, SCP that
c1) set a domain (ip domain-name ...) and hostname.
c2) create a rsa key (crypto key generate rsa) with key bigger as 768 because otherwise the unix workstation could not open a session without changing all the default.
c3) is ssh activated
c4) set the ssh version (ip ssh version 2)
c5) for scp active scp (ip scp server enable)
c6) if you have several interfaces on your device don't forget to set the source interface if you are not sure of the interface which can answer the request (ip ssh source-interface ....)
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
achea
Posts: 6
Joined: Mon Sep 24, 2007 10:01 pm

Post by achea »

it works now
thanx a lot
your advice really help
i found it is because of my misconfiguration in trap_list

excellent tool!!!
thanx again
pepj wrote:
achea wrote:but have some trouble
test from the command line with "php configmanager_poller.php
success
test from the command line with "php configmanager_trap_poller.php
use only "php configmanager_poller.php -d" this will check and start php configmanager_trap_poller.php if needed
achea wrote: have enabled the 'accept event'
syslog can recieve
'%LINK-5-CHANGED: Interface Loopback0, changed state to administratively down '
and i add
"cisco;;1.3.6.1.2.1.11.0.2"
in "configmanager_trap_list.txt"
1.3.6.1.2.1.11.0.2" means LinkDown in cisco oid
but Im not quite sure if i pick the right value
i also tried "cisco;;LinkDown"
The LinkDown or 1.3.6.1.2.1.11.0.2 should be ok in fact it shoud be something that appears in the traps (see the syslog).

1/ have you in the global setting "Up/Download Config Manager" set
accept traps ----> yes
delay to wait after a trap ----> some minutes
2/ in each config you want active:
accept events ----> yes
3/ the config is an "active rule" (not paused)
4/ check in the view "trap events"
You can see:
- the global trap events activation is enabled.
- the delay to wait after a trap is XXmin.
- there is X configurations with trap events enabled.
- you see the list of the confis of configmanager which accept traps
view of the file with the traps
5/ at the beginning active the debug of configmanager in the global setting "Up/Download Config Manager"
6/ is the traps "LinkDown" in syslog ?
achea
Posts: 6
Joined: Mon Sep 24, 2007 10:01 pm

Post by achea »

i wrote a script to download the running config of the route with telnet method
download path was defined in the script
it works in the command line
so i want it works with the configmanager plugin
i choose Multiple configuration type
with no template choosed
i directly put it in the command box:
%g%/scripts/tel.sh %i% %u% %w%

after that i reset the last run time
run the "php configmanager_poller.php"
it returns:
Warning: mkdir(): No such file or directory in /var/www/html/cacti/plugins/configmanager/configmanager_gateway_method_multi.php on line 32

line 32 is:
if (!is_dir($path)) mkdir($path);

in log there is:
exec_background(/var/www/html/cacti/plugins/configmanager/scripts/tel.sh myip aaa *** ) for following hosts: myip

but when i exec " /var/www/html/cacti/plugins/configmanager/scripts/tel.sh myip aaa *** " directly in the command line
it works

whats wrong with that
did i need to edit the template.txt?
please help me
:cry:
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

Post by pepj »

achea wrote: Warning: mkdir(): No such file or directory in /var/www/html/cacti/plugins/configmanager/configmanager_gateway_method_multi.php on line 32
You don't need obligatory the template.txt (only if you need it often)

1/ did you set the parameter "path for the log files (%p%)" ?
If will put more checks for the next release (ex. when it is empty ...)
But until then ... put something there.
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
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

new release of configmanager for cacti 0.8.7 coming soon

Post by pepj »

new release of configmanager for cacti 0.8.7 coming soon

The users of cacti 0.8.7 need a new release because a lot of changes have been done in the new version of cacti....
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
dpartow
Posts: 19
Joined: Thu May 04, 2006 6:53 pm

re: new release of configmanager for cacti 0.8.7 coming soon

Post by dpartow »

I just got my new version of cacti installed with spine and plugin arch 1.3 working great.

I want to use the config manager plugin, but looks like it isn't available for 0.8.7.

Keep me posted.

I am excited to see how it works.

Thanks

:-)
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

new release of configmanager 0.74 for cacti 0.8.7

Post by pepj »

new release (compatible with cacti 0.8.7) of configmanager 0.74 in the first post

http://forums.cacti.net/viewtopic.php?p=59773#59773


-----------------------------------------------------------------
PS: about "TFTP pure PHP" (without pancho)
if you want use the method "TFTP" with the option "pure PHP - without pancho"
  • - You have to install (copy) first the "sharednetworkclass version0.36" for example under "plugins\sharednetworkclass" otherwise you will have to change the path in the config.php of configmanager
    - install the configmanager 0.74
    - in the setting you have to active the possibility to use TFTP pure PHP
    - in the setting you have to give the paths to the snmpset and check the parameters
    - In each config you want use TFTP pure PHP instead Pancho click in the field "pure tftp without pancho".
PS: I have tested "TFTP pure PHP" with Cisco and Foundry, Nortel 55xx OK. It would be nice if someone could tell me if other nortel and the others vendors are OK.

PS: The sharednetwork class 0.36 can be used for a lot of more snmp functions. See the examples
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
achea
Posts: 6
Joined: Mon Sep 24, 2007 10:01 pm

Post by achea »

pepj wrote:
achea wrote: Warning: mkdir(): No such file or directory in /var/www/html/cacti/plugins/configmanager/configmanager_gateway_method_multi.php on line 32
You don't need obligatory the template.txt (only if you need it often)

1/ did you set the parameter "path for the log files (%p%)" ?
If will put more checks for the next release (ex. when it is empty ...)
But until then ... put something there.
I didnt set the %p% parameter

also
when i put it in the pre-command box instead of the command
then reset last run time
run the "php configmanager_poller.php" manually
it works
but when i reset last run time
and let it run automatically
it didnt work
so strange
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

Post by pepj »

achea wrote:
pepj wrote:
achea wrote: Warning: mkdir(): No such file or directory in /var/www/html/cacti/plugins/configmanager/configmanager_gateway_method_multi.php on line 32
1/ did you set the parameter "path for the log files (%p%)" ? ....
I didnt set the %p% parameter
I meant it was a bug of mine if the path was empty even though it was not used.

Therefore download the new version 0.74 or put something (example "tmp") as a path.
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
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

new release 0.75

Post by pepj »

current version: 0.75
bug correction of 0.74 in 0.75:
  • - correction in release 0.75 for traps compatibility with the new version of syslog-plugin
    - bug correction when "multi method" und the path is empty.
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
ranug
Posts: 16
Joined: Tue Jul 03, 2007 12:55 pm
Location: Austria

backslash problem in configmanager 0.75

Post by ranug »

Hi,

It seems that I have a problem with backslash instead of slash.

For example, my expect script "expect /usr/.../myscript.expect" cannot be found as "expect \usr\...\myscript.expect" as I see it in the log.

I added the following to template.txt:
#ssh expect script
name=ssh-cisco-expect
command=expect %g%/scripts/ssh-cisco.expect %i% %u% %w% "sh run" >%g%/expect-test-%n%.txt
help=no help available
and after running "php configmanager_poller.php -d" I have this in my logfile cfgmng_logfile.txt:
2007-11-19 17:17:56 createconfig for configmanager(configid=1)!
2007-11-19 17:17:56 exec_background(expect \usr\share\webapps\cacti\0.8.6j-r6\htdocs\plugins\configmanager\scripts\ssh-cisco.expect 10.0.0.1 username *** "sh run" >\usr\share\webapps\cacti\0.8.6j-r6\htdocs\plugins\configmanager\expect-test-testhost.txt) for following hosts:testhost
But this is all with backslash, it can't work on my linux. There is also no output.

thanks for help,
ranug
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

Re: backslash problem in configmanager 0.75

Post by pepj »

ranug wrote:It seems that I have a problem with backslash instead of slash.
For example, my expect script "expect /usr/.../myscript.expect" cannot be found as "expect \usr\...\myscript.expect" as I see it in the log.
You can change in "configmanager_poller.php" the line 342
from

Code: Select all

                if ($config["cacti_server_os"] == "unix") {
to

Code: Select all

                if ($config["cacti_server_os"] != "win32") {
But something is strange in your system. WHY your system give not "unix" back. (config["cacti_server_os"]). Because this test is also use by all plugins (syslog,manage,....)

can you test what answers your system ? execute under your cacti-path the attached php-file to have the answer.
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
pepj
Cacti User
Posts: 324
Joined: Thu Sep 29, 2005 5:03 am
Location: switzerland

Re: backslash problem in configmanager 0.75

Post by pepj »

pepj wrote:
ranug wrote:It seems that I have a problem with backslash instead of slash.
For example, my expect script "expect /usr/.../myscript.expect" cannot be found as "expect \usr\...\myscript.expect" as I see it in the log.
You can change in "configmanager_poller.php" the line 342
change

Code: Select all

                if ($config["cacti_server_os"] == "unix") {
into

Code: Select all

                if ($config["cacti_server_os"] != "win32") {
But something is strange in your system. WHY your system give not "unix" back. (config["cacti_server_os"]). Because this test is also use by all plugins (syslog,manage,....)

can you test what answers your system ? execute under your cacti-path the attached php-file to have the answer.
Attachments
test.zip
(309 Bytes) Downloaded 741 times
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
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests