Editing
Switch Control
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= Setup MRTG monitoring (SNMP) = Cisco MIBs: ftp://ftp-sj.cisco.com/pub/mibs/supportlists/wsc2900xl/wsc2900xl-supportlist.html<br> http://www.cisco.com/public/sw-center/netmgmt/cmtk/mibs.shtml<br> http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en&translate=Translate&objectInput=lcpu<br> CPU: 1.3.6.1.4.1.9.2.1.58 Configure IP on the switch: <pre>conf t int vlan 1 ip address 69.55.230.245 255.255.255.0 ip default-gateway 69.55.230.1 en</pre> Disable telnet: <pre>conf t line vty 5 15 transport input none</pre> DEPRECATED Setup web user, and enable that user to login to web: <pre>switch-p16(config)#username web privilege 15 password PASS switch-p16(config)#line vty 0 4 switch-p16(config-line)#login local switch-p16(config-line)#en switch-p16(config-line)#password PASS switch-p16(config-line)#login </pre> Disable web: <pre>conf t line vty 0 4 transport input none</pre> Setup ACL: <pre>conf t access-list 1 permit 69.55.230.2 access-list 1 permit 10.1.4.5</pre> Setup SNMP: <pre>conf t no snmp-server community private RW no snmp-server community public RO snmp-server community jc292401 RO 1 en</pre> On mrtg aggregator/host (i.e. mail server) run: <pre>/usr/local/bin/cfgmaker --if-template=template.pl --show-op-down --global "options[_]: growright,bits" --global 'WorkDir: /usr/local/www/mgmt/mrtg/data' --global 'Interval: 1' --global 'LogFormat: rrdtool' --global 'PathAdd: /usr/local/bin' --global 'LibAdd: /usr/local/lib' --host-template=host.pl jc292401@69.55.230.246 --output=switch-p14.cfg</pre> And add new switch to crontab script: <tt>/usr/local/www/mgmt/mrtg/mrtg.sh</tt> template.pl: <pre>#if(not $problem_lines) #{ $target_lines .= <<ECHO; Target[$target_name]: $if_ref:$router_connect SetEnv[$target_name]: MRTG_INT_IP="$if_ip" MRTG_INT_DESCR="$if_snmp_descr" ECHO if ($directory_name) { $target_lines .= "Directory[$target_name]: $directory_name\n"; } $target_lines .= <<ECHO; MaxBytes[$target_name]: $if_speed Title[$target_name]: $if_snmp_alias -- $if_snmp_name -- $sysname PageTop[$target_name]: <h1>$html_desc_prefix$html_if_title_desc -- $sysname</h1> <table> <tr> <td>System:</td> <td>$sysname in $html_syslocation</td> </tr> <tr> <td>Description:</td> <td>$if_snmp_alias</td> </tr> <tr> <td>Interface:</td> <td>$if_snmp_descr</td> </tr> <tr> <td>ifType:</td> <td>$html_if_type_desc ($if_type_num)</td> </tr> <tr> <td>ifName:</td> <td>$html_if_snmp_name</td> </tr> ECHO $target_lines .= <<ECHO; <tr> <td>Max Speed:</td> <td>$if_speed_str</td> </tr> ECHO $target_lines .= <<ECHO if $if_ip; <tr> <td>Ip:</td> <td>$if_ip ($if_dns_name)</td> </tr> ECHO $target_lines .= <<ECHO; </table> ECHO #} else { #$head_lines=""; # $head_lines =~ s/^\# //g; #$problem_lines=""; # $problem_lines =~ s/^\# //g; #$target_lines=""; # $target_lines =~ s/^\# //g; #$separator_lines=""; # $separator_lines =~ s/^\# //g; #$target_lines .= "$head_lines $problem_lines$target_lines $separator_lines"; #}</pre> host.pl: <pre>$head_lines .= <<ECHO; #--------------------------------------------------------------------- ECHO my $target_name = $router_name . ".cpu"; $target_lines .= <<ECHO; YLegend[$target_name]: Percentage CPU load ShortLegend[$target_name]: % Legend1[$target_name]: CPU load in % Legend2[$target_name]: Legend3[$target_name]: Max Observed CPU load Legend4[$target_name]: LegendI[$target_name]: CPU Load: LegendO[$target_name]: WithPeak[$target_name]: ywm MaxBytes[$target_name]: 100 Options[$target_name]: growright, gauge, nopercent Title[$target_name]: $router_name CPU load Target[$target_name]: 1.3.6.1.4.1.9.2.1.58.0&1.3.6.1.4.1.9.2.1.58.0:$router_connect PageTop[$target_name]: <h1>$router_name CPU load</h1> <table> <tr> <td>System:</td> <td>$router_name in $html_syslocation</td> </tr> <tr> <td>Maintainer:</td> <td>$html_syscontact</td> </tr> <tr> <td>Description:</td> <td>$html_sysdescr</td> </tr> <tr> <td>Resource:</td> <td>CPU.</td> </tr> </table> ECHO</pre>
Summary:
Please note that all contributions to JCWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
JCWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information