Hi,

I've made a flex view that tells how long a port is up or down (days,
hour, minutes and seconds).

We use this to identify ports with our users just by telling them to
connect or disconnect the cable.

It also identifies how many times a port changed from forward state.

I believe its a nice tool and that can be pretty useful to others.

If you have any doubt just ring the bell.

For last, if you are making flex views can you share with others?


Regards,
Hugo Veiga

________________________________

UBI amiga do ambiente: Antes de imprimir este e-mail pense bem se tem mesmo que 
o fazer. As árvores são um bem imprescindível.

---
To unsubscribe from enterasys, send email to [email protected] with the body: 
unsubscribe enterasys [email protected]
<?xml version="1.0" encoding="UTF-8"?>
<flextablelist version="4.1.0.72">
    <flextable autoExportCsvTextDelineation="DQUOTE" autoExportFrequencyUnit="Minutes" autoExportFormat="HTML" showHorizontalLines="true" autoExportFilename="" autoExportFileManagement="Replace" highlightBackground="153,255,255,255" class="com.enterasys.netsight.console.client.flexview.FvTable" id="LastPortChange" columnSelectionAllowed="false" autoCreateColumnsFromModel="false" autoExportAllowed="false" autoExportCsvFieldDelimiter="Comma">LastPortChange
        <tableModel>com.ets.nac.tables.TbModel</tableModel>
        <column comparator="com.ets.flextable.col.IntStringComparator" id="0" sortOrder="descending" class="com.enterasys.netsight.console.client.flexview.FvColumn" fixed="true" hidden="true">ReqID
            <notes></notes>
            <dataField>OID::ReqID:::SNMP::ReqID</dataField></column>
        <column comparator="com.ets.nac.tables.TbCompOid" id="1" width="127" sortOrder="descending" class="com.enterasys.netsight.console.client.flexview.FvColumn" fixed="true" modelIndex="1">IP Address
            <notes></notes>
            <dataField>OID::IP Address:::SNMP::IP Address</dataField></column>
        <column comparator="com.ets.nac.tables.TbCompOid" id="2" sortOrder="descending" class="com.enterasys.netsight.console.client.flexview.FvColumn" fixed="true" modelIndex="2">Instance
            <notes></notes>
            <dataField>OID::Instance:::SNMP::Instance</dataField></column>
        <column comparator="com.ets.flextable.col.VarStringComparator" id="104" width="68" sortOrder="descending" class="com.enterasys.netsight.console.client.flexview.FvColumn" modelIndex="3">ifName
            <notes>The ifName Column gives the actual front panel port description to the user.</notes>
            <dataField>OID::ifName:::SNMP::SNMP;false;15;3;false;false;4;2;0;0;0;0</dataField></column>
        <column comparator="com.ets.nac.tables.TbCompExpression" id="113" width="28" sortOrder="descending" class="com.enterasys.netsight.console.client.flexview.FvColumn" cellRenderer="com.ets.nac.tables.TbRendExpression" modelIndex="4">type
            <notes>Blue not down
Red - Never has been up
green - down for 5 minutes
yellow - down for more then 5 min. but has been up since the switch is up</notes>
            <dataField>SNMP::EXPR;true;2;4;false;false;1;2;0;0;0;0</dataField></column>
        <column comparator="com.ets.nac.tables.TbCompExpression" id="114" width="151" sortOrder="descending" class="com.enterasys.netsight.console.client.flexview.FvColumn" cellRenderer="com.ets.nac.tables.TbRendNoIconExpression" modelIndex="5">Time
            <notes>Provides de days hours minutes and seconds since last change</notes>
            <dataField>SNMP::EXPR;true;2;5;false;false;1;2;0;0;0;0</dataField></column>
        <column comparator="com.ets.nac.tables.TbCompExpression" id="116" width="103" sortOrder="ascending" class="com.enterasys.netsight.console.client.flexview.FvColumn" sorted="true" cellRenderer="com.ets.nac.tables.TbRendNoIconExpression" modelIndex="6">Fwd Transitions
            <notes>IF transitions lt uptime in days+10 -- GreenText

if transitions lt 3*uptime in days+10 -- YellowText

Otherwise --redtext</notes>
            <dataField>SNMP::EXPR;true;2;6;false;false;1;2;0;0;0;0</dataField></column>
        <column comparator="com.ets.flextable.col.LongStringComparator" id="115" width="57" sortOrder="descending" class="com.enterasys.netsight.console.client.flexview.FvColumn" hidden="true" modelIndex="7">ForwardTransitions
            <notes>The ifName Column gives the actual front panel port description to the user.</notes>
            <dataField>OID::dot1dStpPortForwardTransitions:::SNMP::SNMP;false;65;7;false;false;4;2;0;0;0;0</dataField></column>
        <column comparator="com.enterasys.netsight.console.client.flexview.FvCompMibEnum" id="101" width="66" sortOrder="descending" class="com.enterasys.netsight.console.client.flexview.FvColumn" modelIndex="8">ifOperStatus
            <notes>The ifOperStatus column provides the user with the current state of the port (Up, Down, Testing, Dormant etc).</notes>
            <dataField>OID::ifOperStatus:::SNMP::SNMP;false;2;8;false;false;4;2;0;0;0;0</dataField></column>
        <column comparator="com.enterasys.netsight.console.client.flexview.FvCompMibEnum" id="109" width="66" sortOrder="descending" class="com.enterasys.netsight.console.client.flexview.FvColumn" modelIndex="9">ifAdminStatus
            <notes>ifAdminStatus column provides the user with the Administrative state of the port, i.e. enabled (up) or disabled (down).</notes>
            <dataField>OID::ifAdminStatus:::SNMP::SNMPW;false;2;9;true;false;4;2;0;0;0;0</dataField></column>
        <column comparator="com.ets.flextable.col.VarStringComparator" id="108" width="540" sortOrder="descending" class="com.enterasys.netsight.console.client.flexview.FvColumn" modelIndex="10">ifAlias
            <notes></notes>
            <dataField>OID::ifAlias:::SNMP::SNMPW;false;15;10;true;false;4;2;0;0;0;0</dataField></column>
        <column comparator="com.ets.nac.tables.TbCompExpression" id="112" width="110" sortOrder="descending" class="com.enterasys.netsight.console.client.flexview.FvColumn" hidden="true" cellRenderer="com.ets.nac.tables.TbRendNoIconExpression" modelIndex="11">sub
            <notes>Subtract the timestamp of the ifLastChange from the sysUpTime to give how long ago the 
interface changed.</notes>
            <dataField>SNMP::EXPR;true;2;11;false;false;1;2;0;0;0;0</dataField></column>
        <column comparator="com.ets.nac.tables.TbCompExpression" id="111" width="112" sortOrder="descending" class="com.enterasys.netsight.console.client.flexview.FvColumn" hidden="true" cellRenderer="com.ets.nac.tables.TbRendNoIconExpression" modelIndex="12">lastchangeseconds
            <notes></notes>
            <dataField>SNMP::EXPR;true;2;12;false;false;1;2;0;0;0;0</dataField></column>
        <column comparator="com.ets.nac.tables.TbCompExpression" id="110" width="210" sortOrder="descending" class="com.enterasys.netsight.console.client.flexview.FvColumn" hidden="true" cellRenderer="com.ets.nac.tables.TbRendNoIconExpression" modelIndex="13">sysupseconds
            <notes></notes>
            <dataField>SNMP::EXPR;true;2;13;false;false;1;2;0;0;0;0</dataField></column>
        <column comparator="com.ets.flextable.col.VarStringComparator" id="100" width="195" sortOrder="descending" class="com.enterasys.netsight.console.client.flexview.FvColumn" hidden="true" modelIndex="14">ifLastChange
            <notes>ifLastChange gives the sysUpTime timestamp when the port state was last changed (NOT how long ago it changed).
Timestamp is in a damn format</notes>
            <dataField>OID::ifLastChange:::SNMP::SNMP;false;67;14;false;false;4;2;0;0;0;0</dataField></column>
        <column comparator="com.ets.flextable.col.VarStringComparator" id="106" width="412" sortOrder="descending" class="com.enterasys.netsight.console.client.flexview.FvColumn" hidden="true" modelIndex="15">sysUpTime
            <notes>Current sysUptime at the time the flexview query was run. 

Timestamp is in a damn format</notes>
            <dataField>OID::sysUpTime:::SNMP::SNMP;true;67;15;false;false;1;2;0;0;0;0</dataField></column>
        <notes>Custom Flexview to determine when a port as changed state for the last time.
Author: Hugo Veiga</notes>
        <dataField>TBLHASH::::IDS_GRAPH_TYPE::0:::IDS_GRAPH_COLUMNS::107:::IDS_GRAPH_AUTO_EXPORT_TYPE::0:::TBLHDR::0;0;true;0;ifXEntry;V.0.3.3.0;2;0;117:::IDS_Y_AXIS_LABEL::% Utilization:::IDS_FV_TBL_INSTRUCTION::blue - connected
green, yellow and red - disconnected::::GEMHASH::::00002:sub::routine 112 { "sysupseconds":110 }  - { "lastchangeseconds":111 } nY8km2TV7M Subtract the timestamp of the ifLastChange from the sysUpTime to give how long ago the 
interface changed.:::00001:lastchangeseconds::routine 111 //segundos

  #(substring({"sysUpTime":100},1+lastindex({ "sysUpTime":100},":"), StringLength({ "sysUpTime":100})))   +

// Minutos
 # (substring({"sysUpTime":100},1+index({ "sysUpTime":100},":"), lastindex({ "sysUpTime":100},":")))   * 60        +     

// Horas 
 #(substring({"sysUpTime":100},1+index({ "sysUpTime":100},"s"), index({ "sysUpTime":100},":")))  * 3600   +

// Dias
 #(substring({"sysUpTime":100},0,index({ "sysUpTime":100},"D")))  * 86400:::00000:sysupseconds::routine 110 //segundos

  #(substring({"sysUpTime":106},1+lastindex({ "sysUpTime":106},":"), StringLength({ "sysUpTime":106})))   +

// Minutos
 # (substring({"sysUpTime":106},1+index({ "sysUpTime":106},":"), lastindex({ "sysUpTime":106},":")))   * 60        +     

// Horas 
 #(substring({"sysUpTime":106},1+index({ "sysUpTime":106},"s"), index({ "sysUpTime":106},":")))  * 3600   +

// Dias
 #(substring({"sysUpTime":106},0,index({ "sysUpTime":106},"D")))  * 86400:::00005::table trunk( a ) #(Substring(#(a),0,Index(a,".") )):::00006:Fwd Transitions::routine 116 var1 = #({ "ForwardTransitions":115:# } );
var2 =  #(substring({"sysUpTime":106},0,index({ "sysUpTime":106},"D")));

IF (var1 &lt; (var2+10)) THEN
GreenText(var1) 
else 
if (var1 &lt; ((3 * var2)+10))  then
YellowText(var1) 
else
redtext(var1) nY8km2TV7M IF transitions &lt; uptime in days+10 -- GreenText

if transitions &lt; 3*uptime in days+10 -- YellowText

Otherwise --redtext:::00004:Time::routine 114 $(trunk({ "sub":112:# } / 86400)) + " Days " + 
$(trunk(({ "sub":112:# } - ((trunk({ "sub":112:# } / 86400))*86400))/3600)) + " h " +

$(trunk((({ "sub":112:# } - ((trunk({ "sub":112:# } / 86400))*86400)) - (3600 * trunk(({ "sub":112:# } - ((trunk({ "sub":112:# } / 86400))*86400))/3600)))/60)) + " m " +

$(((({ "sub":112:# } - ((trunk({ "sub":112:# } / 86400))*86400)) - (3600 * trunk(({ "sub":112:# } - ((trunk({ "sub":112:# } / 86400))*86400))/3600)))%60)) + " s"  nY8km2TV7M Provides de days hours minutes and seconds since last change:::00003:type::routine 113 var1 = #({ "ForwardTransitions":115:# } );


IF { "ifOperStatus":101 } != "down"  THEN 
	BlueIcon()  ELSE
	IF var1 == 0 then
                     redicon() else
	IF { "sub":112:# }  &lt;= 300 THEN
		GreenIcon() ELSE
			YellowIcon()     nY8km2TV7M Blue not down
Red - Never has been up
green - down for 5 minutes
yellow - down for more then 5 min. but has been up since the switch is up
</dataField></flextable></flextablelist>

Reply via email to