in
Search 61,113 posts contributed by 27,511 members or post a topic.
SolarWinds Products
Medium Business Architecture Baseline Configs (0) Application Monitor Templates (87)
Application Monitor Templates specify custom groups of monitors that specify monitoring of specific applications.  Templates can be applied to multiple servers and changes automatically propagate.
ipMonitor Scripts (7)
ipMonitor's External Process Monitor provides the ability ro execute external scripts or processes.  You can use the community created scripts to extend your product.
Orion NCM (formerly Cirrus) Device Templates (55)
Device templates define how NCM should login and interact with a particular device type to perform config management operations. Use these device templates to extend your product.
Kiwi CatTools External Scripts (6) Kiwi CatTools Custom Activity Scripts (0)
Kiwi Syslog Server Rules (0) Kiwi Syslog Server Scripts (12)
Orion NPM Custom Views / Custom Alerts, misc... (37)
Orion Network Performance Monitor (NPM) provides the ability to customize your NPM installation to satisfy almost any use case leveraging custom resource views, alerts, icons/images, scripts, SOL, ASP, etc.
Device Configurations (3)

 

Map Scripts (7) Orion NPM Custom Reports (49)
Orion Network Performance Monitor (NPM) ships with 50+ pre-defined reports out-of-the-box, but if those don't satisfy the data you are looking for, you can create your own report and share.
Orion NPM Universal Device Pollers (105)
Universal Device Pollers allow you to monitor any SNMP- enabled device value that has a MIB, including virtually any statistic that a network device records.  Orion NPM ships with a MIB database that covers a vast majority of network devices or you can create and share your own.
Orion NCM (formerly Cirrus) Custom Scripts (8)
Command line scripts can be used to make changes (e.g., upgrade firmware, reset passwords) across multiple devices simultaneously.    You can use the community-created scripts to automate time consuming changes across your environment or create and share your own.

Automated router/switch tftp backups when config changes

Sign In or Join to download files!

posted by jkeife
Wed, Jul 23 2008

Downloads: 44
File size: 779 B
Views: 1,376
Automated router/switch tftp backups when config changes

Here's a quick and dirty perl script that backs up your cisco ios router and switch configs via tftp when ever someone makes a config change. You need to have activestate perl install and Net::Telnet::Cisco and Timestamp::Simple perl mods.

  1. You need to make sure your devices are sending syslog message to orion.
  2. Create an alert/filter rule in syslog view that looks for messages containing *CONFIG*
  3. Add an alert action that executes an external app.  ie "C:\Perl\bin\perl.exe" D:\scripts\save_router_config.pl ${Hostname}
  4. Copy perl script below. Make necessary changes.  Our routers require usernames and passwords to login.  If you routers only require password, the username variable is ignored.

#!/usr/bin/perl

use Net::Telnet::Cisco;
use Timestamp::Simple qw(stamp);


my $device = "$ARGV[0]";
my $user = "username";
my $pass = "password";
my $enable_pass = "enable_password";
my $backup_host = 'tftp_server';
my $numArgs = $#ARGV + 1;
my $dt = stamp;


if ($numArgs != 1 )
{
    print "usage: save_router_config.pl device name\n";
    exit;
}

my $session = Net::Telnet::Cisco->new(Host => $device );
$session->login($user, $pass);

my @output = "";

if ($session->enable($enable_pass) )
{
    @output = $session->cmd('show privilege');
    print "My privileges: @output";
}
else
{
    warn "Can't enable: " . $session->errmsg;
}

$session->cmd("copy run tftp://$backup_host/configs/$device/$dt-$device.cfg\n\n\n");

$session->close;

Already Joined? Sign in

© 2003 - 2009 SolarWinds, Inc. All Rights Reserved.

Who is SolarWinds?

SolarWinds is rewriting the rules for how companies manage their networks. Guided by a global community of network engineers, SolarWinds develops simple and powerful network management software for networks of all sizes.

What is thwack?

thwack, SolarWinds online community site, was designed by network engineers, for network engineers. thwack is a vibrant, growing community of more than 20,000 IT pros who share a passion for technology.

Explore Resources, Answers, Templates, and Advice

Download Free Networking Tools


Learn More About SolarWinds Products