Query all interfaces

Hi,
Would really appreciate some assistance in what I 'thought' is a simple task
This is what I want to do via TCL / EEM :
1.)  Enumerate all interfaces on the switch or just query the running config
2.)  Query each interface config
3.)  If the interface config doesn't contain the sting 'authentication port-control auto' - send an email with the resulting interface name etc
I'm starting to lose my mind trying to do this 
Thanks and regards,
Bill

Try this:
event manager applet intf-auth
event none
action 001  cli command "enable"
action 002  cli command "show ip int brie"
action 003  set output "$_cli_result"
action 004  set intfs ""
action 005  foreach line "$output" "\n"
action 006   string trim $line
action 007   set line $_string_result
action 008   string length $line
action 009   if $_string_result eq 0
action 010    continue
action 011   end
action 012   regexp "^Interface" "$line"
action 013   if $_regexp_result eq "1"
action 014    continue
action 015   end
action 016   regexp "#" "$line"
action 017   if $_regexp_result eq "1"
action 018    continue
action 019   end
action 020   regexp "^([^[:space:]]+)" "$line" match intf
action 021   cli command "show run interface $intf"
action 022   regexp "authentication port-control auto" "$_cli_result"
action 023   if $_regexp_result eq "0"
action 024    append intfs " $intf"
action 025   end
action 026  end
action 027  string length "$intfs"
action 028  if $_string_result gt "0"
action 029   mail from "[email protected]" to "[email protected]" server "10.1.1.1" subject "Interfaces missing auth port-control" body "The following interfaces are missing 'auth port-control auto': $intfs"
action 030  end

Similar Messages

  • LMS 4.2.3 Query on Interface utilization report

    Hi All,
    Interface Utilization report displays the interface utilization data for each device polled for the Interface Utilization
    template. The information is presented using the percentage specifier.
    For eg its displayed % (Rx Max%,Rx Avg%,RxMin%,
    Tx Max%,Tx Avg%,TxMin%)
    I wants report should have the data(interface utilization In Bytes of data)
    Can we display the data instead of the percentage?? is it possible ???
    Regards,
    Channa

    Hi Channa,
    log into dbreader using the following::
    http://servername : 1741/dbreader/dbreader.html
    or
    https:// servername : 443/dbreader/dbreader.html
    user Id is DBA
    Database Name is upm
    password :: user defined (by default password is c2ky2k)
    1.       Here is the query to get the pollerwise managed MIBObjects:
    "select count (*), PollerName from Poller_Details_Table a,Poller_Definition_Table b where a.PollerId = b.PollerId and b.Poller_State NOT IN (1) Group by b.PollerName;"
    2.       Here is the query to get the total mibobject count for the active pollers
    “select count (*) from Poller_Details_Table a,Poller_Definition_Table b where a.PollerId =
    b.PollerId and b.Poller_State NOT IN (1);”
    Hope it will help
    Thanks-
    Afroz
    ***Ratings Encourages Contributors ***

  • Query on Interface Descriptor

    Hi
    I have a simple question about querying on Interfaces.
    I have an interface called Entity, and 2 implementing classes called Service and ServiceProvider (mapped to tables Services (pk serviceId) and ServiceProviders (pk serviceProviderId)). serviceId and serviceProviderId have independent sequences. In Workbench, both classes are specified as implementing the Entity interface. The Entity interface currently specifies an accessor method getEntityId(), and entityId is a common query key for both classes.
    I want to query against the Entity interface to obtain a single instance, by knowing the entityId and class name.
    How can I formulate a readObject query so that Toplink generates the appropriate SQL:
    select * from services where serviceId = ? or
    select * from serviceProviders where serviceProviderId = ?
    Sorry for the trivial nature of this question - I can't find any examples of querying against interface descriptors in a search of tutorials or the developers guide. The developers guide simply says "If there are multiple implementors of the interfaces, the query returns instances of all implementing classes." and this sounds like it would translate to a UNION ALL SQL query.
    I also have in a separate class a variable one to one mapping where I can specify a class indicator (entityTypeId values). Somehow I feel that I need something like this for the Entity interface descriptor.
    James

    Frankly, this just isn't something that is done that often. In the past decade I can only think of a couple of customers who've asked me about this. I always feel a bit uncomfortable with how querying through interfaces really tends to break polymorphism -- it just doesn't seem very natural from an OO perspective. Now, if instead of an interface you had used a common superclass, that makes more sense. I guess the fact that interfaces don't have state makes this whole area a bit of an OOAD research topic. :)
    That being said, I don't expect TopLink would do an "or" query like you've shown, but would do a UNION.
    My recommendation is to experiement with the queries, perhaps take a look at query-keys (they may be of some help here), and contact support with any feature suggestions you have in this area.
    - Don

  • Query Network interface with C#

    Hello,
    I'm developing a C# winforms application under Windows server 2008 (64bit)
    Is there a way to query all network interfaces installed in the PC and check their IP address and if there is an ethernet connection (connected \ not connected) ?
    I want to do it with Microsoft C# classes. 
    Best regards,
    Z.V

    Hi,
    Solution 1:>
    Step1:>
    UdpClient u = new UdpClient(remoteAddress, 1);
    IPAddress localAddr = ((IPEndPoint)u.Client.LocalEndPoint).Address;
    Step2:>
    foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
    IPInterfaceProperties ipProps = nic.GetIPProperties();
    // check if localAddr is in ipProps.UnicastAddresses
    Solution 2:>
    foreach(NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces())
    if(ni.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 || ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
    Console.WriteLine(ni.Name);
    foreach (UnicastIPAddressInformation ip in ni.GetIPProperties().UnicastAddresses)
    if (ip.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
    Console.WriteLine(ip.Address.ToString());
    Documentation:>
    NetworkInterface.GetAllNetworkInterfaces Method
    Good Tutorial:>
    http://www.codeproject.com/Articles/64975/Detect-Internet-Network-Availability
    Mark as answer or vote as helpful if you find it useful | Ammar Zaied [MCP]

  • How can I query all the members of a group using querbuilder?  I cannot find any related properties

    How can I query all the members of a group using querbuilder?  I cannot find any related properties describing members under /home/groups/s/sample_group in jcr repository.

    Hi,
    FieldPoint Explorer is no longer used to configure FieldPoint systems. However, I do not think that the configuring your system in FieldPoint Explorer is causing the error.
    FieldPoint systems are now setup in Measurement and Automation Explorer (MAX).  Information on setting up FieldPoint systems in MAX can be found in the MAX help under: Installed Products>> FieldPoint. Also, I recommend upgrading to the latest FieldPoint driver and version of MAX.  The FieldPoint VI's will be slightly different when you upgrade, so there is a good chance that this will eliminate the error.
    Regards,
    Hal L.

  • Query on interface

    I am getting "The parameter name [startDate] in the query's selection criteria does not match any parameter name defined in the query" error when querying on interface using TopLink 11g (11.1.3). The interface is implemented by many classes MyImplementationClass being one of them. The query works in TopLink 10g. Is this a bug in 11g? Thanks.
    Here is my code:
    +// subquery+
    ExpressionBuilder subqueryBuilder = new ExpressionBuilder();
    ReportQuery subQuery = new ReportQuery(MySubQueryClass.class, subqueryBuilder);
    +// Main read query+
    ReadAllQuery namedQuery1 = new ReadAllQuery(MyInterface.class);
    ExpressionBuilder expBuilder1 = namedQuery1.getExpressionBuilder();
    subQuery.addAttribute("primaryKey");
    subQuery.setSelectionCriteria(
    subqueryBuilder.get("operationDate").between(
    subqueryBuilder.getParameter("startDate"),
    subqueryBuilder.getParameter("endDate")).and(
    subqueryBuilder.get("primaryKey").equal(expBuilder1.get("primaryKey))));
    namedQuery1.setSelectionCriteria(expBuilder1.get("valueDate")
    +.between(expBuilder1.getParameter("startDate"),+
    expBuilder1.getParameter("endDate")).and(
    expBuilder1.get("primaryKey").notExists(subQuery)));
    namedQuery1.addArgument("startDate", java.sql.Date.class);+
    namedQuery1.addArgument("endDate", java.sql.Date.class);+
    // Stack trace
    DEBUG 15:52:54 - ClientSession(27122014)--Exception [TOPLINK-6094] (Oracle TopLink - 11g Release 1 (11.1.1.3.0) (Build 100323)): oracle.toplink.exceptions.QueryException
    Exception Description: The parameter name [startDate] in the query's selection criteria does not match any parameter name defined in the query.
    Query: ReadAllQuery(*myPackage.MyImplementationClass*)Local Exception Stack:
    Exception [TOPLINK-6094] (Oracle TopLink - 11g Release 1 (11.1.1.3.0) (Build 100323)): oracle.toplink.exceptions.QueryException
    Exception Description: The parameter name [startDate] in the query's selection criteria does not match any parameter name defined in the query.
    Query: ReadAllQuery(myPackage.MyImplementationClass)
    at oracle.toplink.exceptions.QueryException.parameterNameMismatch(QueryException.java:996)
    at oracle.toplink.internal.expressions.ParameterExpression.getValue(ParameterExpression.java:227)
    at oracle.toplink.internal.databaseaccess.DatabaseCall.translate(DatabaseCall.java:914)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:192)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:179)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:250)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:583)
    at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2483)
    at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2441)
    at oracle.toplink.queryframework.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:467)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:874)
    at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:674)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:835)
    at oracle.toplink.queryframework.ReadAllQuery.execute(ReadAllQuery.java:445)
    at oracle.toplink.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:2265)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1079)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1063)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1022)
    at oracle.toplink.descriptors.InterfacePolicy.selectAllObjectsUsingMultipleTableSubclassRead(InterfacePolicy.java:171)
    at oracle.toplink.queryframework.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:462)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:874)
    at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:674)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:835)
    at oracle.toplink.queryframework.ReadAllQuery.execute(ReadAllQuery.java:445)
    at oracle.toplink.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:2265)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1079)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1063)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1037)

    Try using the outer query for the parameters,
    change,
    subqueryBuilder.getParameter("startDate"),
    to,
    expBuilder1.getParameter("startDate"),
    If that does not work, try the query without the sub-query to determine if the sub-query is the cause.
    It could be a bug with the sub-query, if you can recreate it on EclipseLink you could log a bug, or contact Oracle support.
    James : http://www.eclipse.org/eclipselink/

  • Querying on interface

    I noticed that Kodo 3.3 supports query on interface - is it part of JDO 2.0
    persistent interface support? What else is implemented? Can we associate
    Interface with Implementation to do the rest of the staff?

    >I noticed that Kodo 3.3 supports query on interface - is it part of JDO 2.0
    persistent interface support? What else is implemented? Can we associate
    Interface with Implementation to do the rest of the staff?We've had querying on interfaces for a long time!
    The Kodo implementation is currently different than JDO 2, in that JDO 2
    requires you to explicitly list your persistent interfaces in metadata, along
    with which classes implement them. Kodo currently just dynamically tracks which
    persistent classes implement which interfaces, and turns any query on an
    interface into a query on the set of the implementing classes.

  • How to connect to SQL*Plus and issue a query all in one command?

    Hi everyone,
    Does anyone know of a way to connect to a db with SQL*Plus, and issue a simple query, all with one command?
    I know that I can save a .sql script with a query, then do this:
    sqlplus user/pwd@db @myscript.sql
    But I'm wondering if there's any way to put the actual query right into the connect command, something like:
    sqlplus user/pwd@db "select count(*) from dba_tables;"
    Does anyone know of a way to do this?

    you didn't mention windows or unix. so, here's a link with both
    Re: windows sql script
    it also has a link to another thread on how to deal with the parens when using ehco in dos.

  • ACE - Query VLAN Interfaces Status

    Hi,
    I am wondering what the status of the query vlan interface means in the command 'show ft peer detail':
    Query Vlan IF State          : UP, Manual validation - please ping peer
    I am pretty sure that I did not see this status when I configured query vlan last time. Current version is A2(2.3).
    Unfortunately this status does not seem to be documented anywhere on CCO.
    I appreciate any help!
    Thanks,
    Daniel

    Hi Daniel,
    The FT Query VLAN interface is an optional, yet very good, feature to be used when using redundant ACE modules or appliances. Without it, if the FT VLAN was to go down, the standby ACE will no longer receive FT heartbeats from the active ACE and therefore take the active role.  However, if the active ACE is still running fine in the active role, then you don't want the standby ACE to take over as active because that will put them into an active/active scenario, which may lead to connectivity issues.
    This is where the FT Query VLAN interface comes in.  If the FT VLAN goes down, the standby ACE will notice this, but before taking the active role, it will ping it's peer IP address configured on the interface that is designated as the FT Query VLAN.  If the ping is successful, then it will stay in the standby role, thereby saving you some headaches.
    The status that you are seeing is the ACE's way of telling you that the interface is UP, but if you want to know if it can successfully ping the peer IP address, then you would have to manually ping the peer IP address from the CLI.  The ACE does not periodically check the ping connectivity through any automatic mechanism.  The automatic mechanism is only triggered by the FT VLAN going down.
    Does this help?
    Sean

  • Disadvantage of 'QUERY ALL RECORDS' set to YES in DATA BLOCK

    Dear all,
    Can any one tell me disadvantage of 'QUERY ALL RECORDS' set to YES in DATA BLOCK. I have made a datablock 'QUERY ALL RECORDS' set to YES becoz of requirement 'restrict duplicate data entry'.For your information
    my datablock is multi record.
    Than You

    What if you have 1,000,000 records in your table and you query all records. Ouch!
    restrict duplicate data entryThat is standard database functionality: primary or unique key on the table.

  • NetFlow on All Interfaces

    Hi All,
    We are using ManageEngine NetFlow Analyzer to monitor our network traffic.
    We have a few VLAN interfaces on the switch where we have enabled flow-export ingress and egress. We can see traffic that is passing between the VLANs on which flow-export has been configured. However, we have on interface that is connected to remote locations. We have not enabled flow-export on this interface. The idea was that, we have enabled ingress and egress flow-export, and the remote locations connect to VLANs where flow-export is already enabled, we must get all traffic from there. But we cannot see traffic from the remote locations, but we can see traffic from inside network to remote locations.
    After checking ManageEngine documentation, I see that we have to enable netflow on all interfaces to get accurate report. Can anyone let me know why this is required. We already have ingress and egress flow-export, and we must be getting all traffic. Please suggest.
    Thanks in advance,
    Faiz

    Hello Faiz,
    As you probably know, NetFlow by default is only collected ingress.  The ingress flows collected on all interfaces are used to display the outbound traffic on a selected interface.  I don't know about ManageEngine but, in some NetFlow solutions, interfaces without NetFlow/IPFIX enabled will not be displayed regardless of whethor or not flows are going out of it.
    Regarding ingress/egress being enabled on the same interface.  If you are using flexible NetFlow to configure the export, make sure the "flow direction" is exported in the template. The commands to export both look like this:
    ip flow monitor andrew-mon input
    ip flow monitor andrew-mon output
    Here is a good article on enabling ingress and egress NetFlow. Realize that just because you export both ingress and egress on a single interface and you export the direction, this doesn't mean the NetFlow solution will report on the data with a behavior that you would expect. 
    Ingress and egress flows are exported at the same time with only one difference "flow direction".  For this reason, this element must be included in the template to ensure that utilization isn't overstated in the flow report.  Again, this of course depends on your reporting solution.  
    Many vendors can't deal with a mixture of ingress and egress flows being enabled in a seemingly random fashion on the same device.  In other words, they expect all ingress or all egress.  Only a few vendors can handle a hybrid approach.
    I hope this helps. 
    Jake

  • Query all tables of specific owner

    Hi all,
    I would like to know wether a value appears in my database or not.
    In other words, I have to query all tables of an owner.
    Table by table is no option, because that owner contains about 25,000 tables.
    Anyone with a script??
    thanks in advance

    scott@ORA92> CREATE OR REPLACE PROCEDURE find_value
      2    (p_value      IN VARCHAR2,
      3       p_data_type  IN VARCHAR2,
      4       p_owner      IN VARCHAR2 DEFAULT USER)
      5  AS
      6    v_exists      NUMBER;
      7  BEGIN
      8    FOR rec IN
      9        (SELECT owner, table_name, column_name
    10         FROM      all_tab_columns
    11         WHERE  data_type = p_data_type
    12         AND      owner = p_owner)
    13    LOOP
    14        BEGIN
    15          EXECUTE IMMEDIATE
    16            'SELECT 1 FROM DUAL WHERE EXISTS (SELECT 1 FROM "'
    17            || rec.owner || '"."' || rec.table_name
    18            || '" WHERE ' || rec.column_name || '=:p_value)'
    19            INTO v_exists USING p_value;
    20          DBMS_OUTPUT.PUT_LINE (rec.table_name || '.' || rec.column_name);
    21        EXCEPTION
    22          WHEN NO_DATA_FOUND THEN NULL;
    23        END;
    24    END LOOP;
    25  END find_value;
    26  /
    Procedure created.
    scott@ORA92> SHOW ERRORS
    No errors.
    scott@ORA92> SET SERVEROUTPUT ON
    scott@ORA92> EXECUTE find_value (10, 'NUMBER', 'SCOTT')
    DEPARTMENTS.DEPARTMENT_ID
    DEPT.DEPTNO
    EMP.DEPTNO
    EMPLOYEES.DEPARTMENT_ID
    STATS.VALUE
    PL/SQL procedure successfully completed.
    scott@ORA92> EXECUTE find_value ('CLERK', 'VARCHAR2', 'SCOTT')
    EMP.JOB
    PL/SQL procedure successfully completed.
    scott@ORA92> EXECUTE find_value (TO_DATE ('12-JAN-1983', 'DD-MON-YYYY'), 'DATE', 'SCOTT')
    EMP.HIREDATE
    PL/SQL procedure successfully completed.
    scott@ORA92> DROP PROCEDURE find_value
      2  /
    Procedure dropped.
    scott@ORA92> spool off

  • Query/Read Interface for API

    Is there a query/read interface from the HRMS API's or from the TCA API's?
    We are using customers online to maintain data , but I want to have a custom application to view the data.
    Obvious choice would be through the TCA API's but I cannot find any Query/Read Interfaces there.
    Oracle's Docs seem to say it's possible so could somebody point me in the right direction please
    cheers
    Dominic

    Anyone have any idea of it ?

  • Query all applications that are connected to database in the current time

    Dears,
    I need to query all applications that are connected to database in the current time. I tried using v$session but i could not reach through it to the application that are logged now to database.
    As example, i connect to DB through Web Application and tried to search in v$session to can see Web Application session but i did not see it :(
    From searching in google, found that there is a package named "DBMS_APPLICATION_INFO". I expected that it can help me in my request but i could not use it.
    Please, advise me. Is this package help cover my requirements or there is another method ?
    Thanks & Best regards,

    sybrand_b,
    I think that i appreciated you once you replied me and what i wanted exactly from you "Provide me Link help me more for investigation" and you did not provide something.
    Where is the documentation that i could not read it !!!!!!
    FYI, you are not the only one that have information_
    Anyway ,as usual i will reply you in polite way.
    Thanks and i will not have more input here with you !!!
    Dear All,
    Sorry for wasting your time to read this but i had to reply.
    Please, if any one have more information regarding my issue, it will be highly appreciated.
    Really , thanks all for support.
    Thanks & Regards,

  • Why can't GB let me use 'electric guitar' option when using Nio 2/4 interface - I have to use real instrument and miss out on all the effects. Is this normal for all interfaces?

    Why can't GB let me use 'electric guitar' option when using Nio 2/4 interface - I have to use real instrument and miss out on all the effects. Is this normal for all interfaces? The Nio reads hte guitar but GB doesn't....

    Usually effects packages are AU plugins that would have no effect on track selection. Interfaces should have no control over what kind of track you can select. I really think something else is going on her maybe something you overlooked.
    Did you choose the input channel in the track info pane. Try both channel 1 mono or channel 2 mono. Make sure the track is record enabled.

Maybe you are looking for

  • Changed iCloud phone number; not updated for keychain response after 3 days.

    Hi, I was correcting a keychain error that can occur (it seems) that asks for about 10-15 local keychain password checks upon booting. That issue is logged in the forum and easy to correct. What subsequently was required was resetting my keychains on

  • Free alternative to adobe indesign for macbook air

    I have experience in using adobe indesign however I have just brought a MacBook air and my copy of indesign is on my windows machine! is there a free alternative to indesign that anyone can recommend or someway of me getting it from a windows to a ma

  • Flash CS5, Snow Leopard and Font Problems

    I'm wondering if anyone else has experienced this issue and might have a quick fix for it: I have a couple of Flash projects that were originally built in CS3.  Last year I upgraded them to CS5 without trouble.  Recently I have upgraded my Macs to Sn

  • Dock problem: Apps won't open, they bounce once and don't open.

    hi, my ex-girlfriend has had problems with opening up some of her programs (Mail, Safari, iChat, iTunes, Msn-Messenger, Skype) on the dock. They bounce on the dock once and then don't open at all. She said that it just happened after a recent update

  • Image swap without resize

    Greetings. I have to create image swaps without having the image resize to the layer size. Is there a way to do this? Is there a behavoiur I can purchase that will do this? Any help appreciated. Remove $$ to email directly. Thanks.