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
public function saveCpeConfig(UbntCpe $cpe): bool | |
{ | |
$config = $cpe->getConfigString(); | |
try { | |
$ssh = $this->startSSH($cpe->ip); | |
} catch (SSHConnectionException $e) { | |
return false; // failed to connect | |
} |
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
<?php | |
namespace App\Ldap; | |
use App\Models\User as DatabaseUser; | |
use Illuminate\Support\Str; | |
use LdapRecord\Models\ActiveDirectory\User as LdapUser; | |
use Storage; | |
class PhotoAttributeHandler |
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
TEst |
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
function build_bgp_peers($device, $data, $peer2) | |
{ | |
d_echo("Peers : $data\n"); | |
$remove_oid_prefixes = array( | |
'ARISTA-BGP4V2-MIB::aristaBgp4V2PeerRemoteAs.1.', | |
'CISCO-BGP4-MIB::cbgpPeer2RemoteAs.', | |
'BGP4-MIB::bgpPeerRemoteAs.', | |
'.1.3.6.1.4.1.2636.5.1.1.2.1.1.1.13.' | |
); |
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
descriptors = set() | |
def print_open_fds(print_all=False): | |
global descriptors | |
(frame, filename, line_number, function_name, lines, index) = inspect.getouterframes(inspect.currentframe())[1] | |
fds = set(os.listdir('/proc/self/fd/')) | |
new_fds = fds - descriptors | |
closed_fds = descriptors - fds | |
descriptors = fds | |
if print_all: |
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
discovery: | |
- sysObjectId: foo | |
- { sysObjectId: bar, sysDescr: snafu } | |
# OR | |
discovery: | |
- | |
sysObjectId: foo | |
- |
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
Scanning "/home/murrant/.snmpsim/variation" directory for variation modules... | |
Directory "/home/murrant/.snmpsim/variation" does not exist | |
Scanning "/usr/lib/python-exec/python3.5/../../../snmpsim/variation" directory for variation modules... | |
A total of 9 modules found in /usr/lib/python-exec/python3.5/../../../snmpsim/variation | |
Scanning "/usr/lib/python-exec/python3.5/../../../share/snmpsim/variation" directory for variation modules... | |
Directory "/usr/lib/python-exec/python3.5/../../../share/snmpsim/variation" does not exist | |
Scanning "/usr/lib64/python3.5/site-packages/snmpsim/variation" directory for variation modules... | |
Directory "/usr/lib64/python3.5/site-packages/snmpsim/variation" does not exist | |
Initializing variation modules... | |
Variation module "redis" load FAILED: Redis connect parameters not specified |
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
namespace LibreNMS; | |
class SNMP | |
{ | |
/** | |
* @param array $device | |
* @param string|array $oids single or array of oids to get | |
* @param string $mib Additional mibs to search, optionally you can specify full oid names | |
* @param string $mib_dir Additional mib directory, should be rarely needed, see definitions to add per os mib dirs | |
* @return array array or object of results, format to be determined |
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
json($type) { | |
$class = 'App\Graphs\' . ucfirst($type); | |
$data=new $class($variable, $variable); | |
return $data->json(); | |
} | |
png($type) { |