This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# simple script to collect some snmp information from a list of switches and interfaces and dump the result into $DIR | |
# currently configured to grab the in and out octet counters | |
# provide a hash of the network device and the if indexes that you wish to monitor, | |
# eg ["rtr-farm02"]="380 53 58" will monitor the device rtr-farm02 on if index 380, 53 and 58 | |
declare -A INTERFACES | |
INTERFACES=( ["swh-farm02a"]="12" ["rtr-farm02"]="380 53 58" ["rtr-farmcore1"]="117" ["rtr-core1"]="9" ["rtr-border2"]="20 3 7" ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yaml | |
def locate_phone_number( s, country_code='1', region_code='650', region_digits=7, internal_digits=4, country_digits=10, locations={}, **kwargs ): | |
s = str(s) | |
# internal number | |
if len(s) == internal_digits: | |
return 'internal', None, s |