Git Product home page Git Product logo

pymt's Introduction

Specifying a filter

When you run ./mndp.py, you'll get to see records like the following:

{'hw': u'RB750Gr2',
 'id': u'MikroTik',
 'iface': u'ether2',
 'ip': u'172.18.15.11',
 'mac': 'e4:8d:8c:ad:12:8a',
 'platform': u'MikroTik',
 'softid': u'IJ47-CMK9',
 'up': u'12999',
 'version': u'6.33.5 (stable)'}

Each of the names hw, id, iface, ip, mac, platform, softid, up and version can be used to filter the output. When present, a filter string for such a name will be compared to the corresponding value in the record. The filter string will be interpreted as a regular expression, see https://docs.python.org/2/library/re.html for more information.

Filter names that are not specified always match the corresponding string value. So in the example above, specifying only the filter string RB.* (so any string starting with the letters 'RB') for the name hw will match the record.

Important remarks:

  1. Care must be taken when using an asterisk * on the command line, since this may be expanded to a filename by the shell in use (e.g. 'bash') before the actual parameter is passed to the program. When in doubt, surround the string on the command line with single or double quotes.

  2. The matching algorithm only looks at the string as present in the record above, and for the MAC address only lowercase letters will be used in such a record. This means that when specifying a filter for a MAC address, lowercase letters need to be used. In the example, specifying e4.* for the mac property will match, but E4.* won't. This also applies to full MAC addresses: specifying E4:8D:8C:AD:12:8A will not match!

Debug info

Set environment variable PYMT_VERBOSE for more debugging output. This can be done for all following commands using

export PYMT_VERBOSE=1

It can also be set just for the command to be executed by specifying it on the same line, for example

PYMT_VERBOSE=1 ./batch_resetanduploadconfig.py -single conf.txt

pymt's People

Contributors

j0r1 avatar

Watchers

James Cloos avatar Lizyliposomize avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.