Skip to content

Instantly share code, notes, and snippets.

View jkeroes's full-sized avatar

Joshua jkeroes

View GitHub Profile
#!/usr/bin/env perl
use 5.10.0;
use Email::Folder::Exchange::EWS;
use Email::MIME;
use Try::Tiny;
use YAML::XS;
my $uri = 'https://secure.integratelecom.com/ews/exchange.asmx';
my $user = 'INTEGRA\jkeroes';
@jkeroes
jkeroes / exchange-email.pl
Last active December 20, 2015 21:08
Exchange Perl client
#!/usr/bin/env perl
use 5.10.0;
use autodie;
use Email::Folder::Exchange::EWS;
use Email::MIME;
my $uri = 'https://example.com/ews/exchange.asmx';
my $user = 'DOMAIN\userid';
my $pass = 'password1';
@jkeroes
jkeroes / gist:8945747
Created February 11, 2014 22:39
pan fw01
======= Response for DC ogddevucaimdc01:eaa25053-2d85-4453-be6d-c6600bc7a39d =======
Search string 172.16.183.81 returned 98 results (71,022 bytes)
Detailed SNMP Log for 172.16.183.81
Feb 11 14:29:31.190: Enabling SNMP logging
Feb 11 14:29:50.855: Send SNMP request [Initial Q position: 0 / Delay: 0 ms], Q Size: 0: GET[requestID=1873277, errorStatus=Success(0), errorIndex=50, VBS[1.3.6.1.2.1.1.3.0 = Null]]
Feb 11 14:29:50.856: Send SNMP request [Initial Q position: 0 / Delay: 0 ms], Q Size: 0: GET[requestID=1873278, errorStatus=Success(0), errorIndex=0, VBS[1.3.6.1.2.1.1.3.0 = Null]]
Feb 11 14:29:50.856: Send SNMP request [Initial Q position: 0 / Delay: 0 ms], Q Size: 0: GET[requestID=1873279, errorStatus=Success(0), errorIndex=0, VBS[1.3.6.1.2.1.1.3.0 = Null]]
Feb 11 14:29:50.856: Send SNMP request [Initial Q position: 0 / Delay: 0 ms], Q Size: 0: GET[requestID=1873280, errorStatus=Success(0), errorIndex=50, VBS[1.3.6.1.2.1.1.3.0 = Null]]
Feb 11 14:29:50.882: Received SNMP response [Resp Time: 24 ms / Trans
======= Response for DC ogddevucaimdc01:eaa25053-2d85-4453-be6d-c6600bc7a39d =======
Search string 172.16.183.81 returned 420 results (330,964 bytes)
On-Demand Log for 172.16.183.81
Feb 06 11:19:20.824: Scheduled poll request at offset=14449 request=IcmpPollRequest [serialVersionUID=1, dcmId=ogddevucaimdc01:eaa25053-2d85-4453-be6d-c6600bc7a39d, itemId=9572, deviceItemId=9572, hostname=, internetAddress=172.16.183.81, numberOfTries=1, timeout=3000, packetSize=64, pollGroupId=101, cycles=0]
Feb 06 11:19:20.943: Received Poll Request: [SnmpPollRequest [internetAddress=172.16.183.81, pollGroupId=151, deviceItemId=9572, itemIdMap={ (item id=9572, index list=[])} ] ]
Feb 06 11:19:20.943: Scheduled poll request at offset=281902 request=SnmpPollRequest [internetAddress=172.16.183.81, pollGroupId=151, deviceItemId=9572, itemIdMap={ (item id=9572, index list=[])} ]
Feb 06 11:19:20.943: Successfully scheduled poll request for pollGroupId=151, IP=172.16.183.81
Feb 06 11:19:20.971: Received Poll Request: [SnmpPollRequest
======= Response for DC ogddevucaimdc01:eaa25053-2d85-4453-be6d-c6600bc7a39d =======
Search string 172.16.183.81 returned 130 results (86,522 bytes)
Detailed SNMP Log for 172.16.183.81
Feb 11 14:29:31.190: Enabling SNMP logging
Feb 11 14:29:50.855: Send SNMP request [Initial Q position: 0 / Delay: 0 ms], Q Size: 0: GET[requestID=1873277, errorStatus=Success(0), errorIndex=50, VBS[1.3.6.1.2.1.1.3.0 = Null]]
Feb 11 14:29:50.856: Send SNMP request [Initial Q position: 0 / Delay: 0 ms], Q Size: 0: GET[requestID=1873278, errorStatus=Success(0), errorIndex=0, VBS[1.3.6.1.2.1.1.3.0 = Null]]
Feb 11 14:29:50.856: Send SNMP request [Initial Q position: 0 / Delay: 0 ms], Q Size: 0: GET[requestID=1873279, errorStatus=Success(0), errorIndex=0, VBS[1.3.6.1.2.1.1.3.0 = Null]]
Feb 11 14:29:50.856: Send SNMP request [Initial Q position: 0 / Delay: 0 ms], Q Size: 0: GET[requestID=1873280, errorStatus=Success(0), errorIndex=50, VBS[1.3.6.1.2.1.1.3.0 = Null]]
Feb 11 14:29:50.882: Received SNMP response [Resp Time: 24 ms / Trans
DEBUG | nDemand-thread-3 | 2014-02-12 12:52:10,236 | nagedDeviceResourceDiscoveryImpl | l.ComponentCreatorOnReadListener 70 | y-manager.inventory.impl |
| DeviceID: 9834 onReadComplete - Results:Item ID=9834, error=SUCCESS
Attribute: {http://im.ca.com/normalizer}IntegraFirewallSessions.Descriptions = PAN Sessions
Attribute: {http://im.ca.com/normalizer}IntegraFirewallSessions.ActiveSessionsUDP = {0}
Attribute: {http://im.ca.com/normalizer}IntegraFirewallSessions.MaxSessions = {2097138}
Attribute: {http://im.ca.com/normalizer}IntegraFirewallSessions.ActiveSessions = {1}
Attribute: {http://im.ca.com/normalizer}IntegraFirewallSessions.Indexes = 0
Attribute: {http://im.ca.com/normalizer}IntegraFirewallSessions.ActiveSessionsPct = {0%}
Attribute: {http://im.ca.com/normalizer}IntegraFirewallSessions.Names = PAN Sessions
Attribute: {http://im.ca.com/normalizer}IntegraFirewallSessions.ActiveSessionsUtilization = {0}
@jkeroes
jkeroes / IntegraFirewallSessions.xml
Created February 12, 2014 21:04
IntegraFirewallSessions for PAN firewalls
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2013 CA. All rights reserved.
This software and all information contained therein is confidential and
proprietary and shall not be duplicated, used, disclosed or disseminated in any
way except as authorized by the applicable license agreement, without the
express written permission of CA. All authorized reproductions must be marked
<?xml version="1.0" encoding="UTF-8"?>
<!--Auto-generated by the type catalog local manager.-->
<DataModel namespace="http://im.ca.com/inventory" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ComponentFacet.xsd">
<FacetType name="IntegraFirewallSessions">
<Documentation>Firewall session counts</Documentation>
<FacetOf namespace="http://im.ca.com/core" name="Item" />
<Attribute name="ActiveSessions" cached="true" persistent="true" type="int">
<Documentation>The Active Sessions count.</Documentation>
</Attribute>
<Attribute name="ActiveSessionsICMP" cached="true" persistent="true" type="int">
<?xml version="1.0" encoding="UTF-8"?>
<!--Auto-generated by the type catalog local manager.-->
<DataModel namespace="http://im.ca.com/normalizer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="IMDBCertificationFacet.xsd">
<FacetType name="IntegraFirewallSessions" descriptorClass="com.ca.im.core.datamodel.certs.NormalizedFacetDescriptorImpl">
<Documentation>Defines the session-related metrics on a PAN firewall.</Documentation>
<FacetOf namespace="http://im.ca.com/core" name="Item" />
<AttributeGroup name="AttributeGroup" external="true" list="true">
<Attribute name="ActiveSessions" type="int">
<Documentation>The Active Sessions count.</Documentation>
<Polled>true</Polled>
@jkeroes
jkeroes / gist:a9ae6be73fc6106d9a1e
Created June 6, 2014 18:20
Perl and memory leak handling
## Memory leaks
Tracking memory leaks:
Devel::Arena - sv_stats() returns arena structures used for SV allocation
* Devel::Cycle - find_cycle($ref) returns all cycles found in $ref and the perl variables they point to
Devel::Gladiator - walk Perl variable arena
Devel::Leak - deprecated by Devel::LeakTrace::Fast
Devel::LeakTrace - deprecated by Devel::LeakTrace::Fast
* Devel::LeakTrace::Fast - prints leaked SV's and line numbers at END.
Data::Structure::Util - has_circular_ref($ref) returns ref to link in $ref that is circular or false.