Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Announcements
  3. NxShell

NxShell

Scheduled Pinned Locked Moved Announcements
10 Posts 3 Posters 36.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A
    A
    Alex Kirhenshtein
    wrote on last edited by
    #1

    Hello.

    After couple of requests we made a  small tool to help automate operations, which are currently available only thru user interface or java api. In essence, it's wrapper around Jython (Java implementation of Python) and NetXMS API, with some glue in between to make it easier to use.

    More details in our Wiki: http://wiki.netxms.org/wiki/Using_nxshell_to_automate_bulk_operations

    1 Reply Last reply
    0
    • T
      T
      testos
      wrote on last edited by
      #2

      Hello Alex.

      Thanks for this tool, I'm very interested in trying it.
      Is it possible to automate any task we can be done by console?
      Is there available other sample scripts in addition to the one in the wiki?

      Best regards.

      1 Reply Last reply
      0
      • A
        A
        Alex Kirhenshtein
        wrote on last edited by
        #3

        Yes, all operations done by GUI can be done using API. Right now it's just a raw Java API with some glue for more convenient use, but I plan to make it more Python-ish.

        I can add more samples – do you have any particular idea in mind?

        1 Reply Last reply
        0
        • T
          T
          testos
          wrote on last edited by
          #4

          I had planned to read nodes from a file and check if exist in certain containers. If they did not exist would be created and then:

          • Modify some node properties: polling options, comments, custom attributes, calculation status, etc.
          • Manage network interfaces only having a certain name, others unmanaged.
          • Create DCI for managed interfaces.
          • Edit some properties for the previous DCIs (description, transformation, thresholds, etc..)
          • Create other DCI for node (MTBF & MTTR -https://www.netxms.org/forum/general-support/mtbf-(mean-time-between-failures)-and-mttr-(mean-time-to-repair)/msg8953/#msg8953-, etc.)

          All this for about 400 nodes  :-[.

          Best regards.

          1 Reply Last reply
          0
          • S
            S
            SKYnv
            wrote on last edited by
            #5

            @testos said in NxShell:

            • Modify some node properties: polling options, comments, custom attributes, calculation status, etc.
            • Edit some properties for the previous DCIs (description, transformation, thresholds, etc..)

            y can do this with sql query

            1 Reply Last reply
            0
            • A
              A
              Alex Kirhenshtein
              wrote on last edited by
              #6

              I've added couple more samples to Wiki (http://wiki.netxms.org/wiki/Using_nxshell_to_automate_bulk_operations#Sample_Scripts)

              1 Reply Last reply
              0
              • T
                T
                testos
                wrote on last edited by
                #7

                Thank you very much for your support, it is just what I needed.
                nxshell opens a world of great possibilities for large environments!

                Best regards.

                1 Reply Last reply
                0
                • T
                  T
                  testos
                  wrote on last edited by
                  #8

                  Hi Alex.

                  I'm trying NetXMS 1.2.5 Interactive Shell and and I can see it's a nice tool. It is much easier any automatic bulk operation.

                  NetXMS 1.2.5 Interactive Shell
                  >>> help()

                  Welcome to Python 2.5!  This is the online help utility.

                  But Interactive Shell use python 2.5 vesion and the latest current production versions is Python 3.3.0
                  I'm trying to modify nxshell-1.2.5.jar contents to replace the lib directory from 3.3.0 version, but then I get an error in org.python.core
                  How can I upgrade python shell to 3.3.0 version?
                  I need to import some Python modules which only work with 2.7 version and later.

                  Best regards.

                  1 Reply Last reply
                  0
                  • A
                    A
                    Alex Kirhenshtein
                    wrote on last edited by
                    #9

                    It's build around Jython which is 2.5.4 right now (not CPython, which is 3.3.0 right now), 2.7 is in beta stage.
                    I've did couple of quick tests with 2.7-beta1 version and it seems to work fine. You can try this jar: https://netxms.org/nxshell-1.2.5_jython27.jar.

                    1 Reply Last reply
                    0
                    • T
                      T
                      testos
                      wrote on last edited by
                      #10

                      Hi Alex.

                      Thanks for the upgrade to 2.7 version and for the Jython versions clarification. Now I can add current versions of modules I need. It is also possible to list all availables modules (in the previous version modules command gave me an error):

                      NetXMS 1.2.6 Interactive Shell
                      >>> import xlrd
                      >>> help()

                      Welcome to Python 2.7!  This is the online help utility.

                      If this is your first time using Python, you should definitely check out
                      the tutorial on the Internet at http://docs.python.org/tutorial/.

                      Enter the name of any module, keyword, or topic to get help on writing
                      Python programs and using Python modules.  To quit this help utility and
                      return to the interpreter, just type "quit".

                      To get a list of available modules, keywords, or topics, type "modules",
                      "keywords", or "topics".  Each module also comes with a one-line summary
                      of what it does; to list the modules whose summaries contain a given word
                      such as "spam", type "modules spam".

                      help> modules

                      Please wait a moment while I gather a list of all available modules...

                      BaseHTTPServer      codecs              jffi                sched
                      CGIHTTPServer      codeop              json                select
                      ConfigParser        collections        keyword            sets
                      Cookie              colorsys            linecache          setuptools
                      DocXMLRPCServer    command            locale              sgmllib
                      HTMLParser          commands            logging            sha
                      MimeWriter          compileall          macpath            shelve
                      Queue              compiler            macurl2path        shlex
                      SimpleHTTPServer    contextlib          mailbox            shutil
                      SimpleXMLRPCServer  cookielib          mailcap            signal
                      SocketServer        copy                markupbase          site
                      StringIO            copy_reg            marshal            smtpd
                      UserDict            csv                math                smtplib
                      UserList            ctypes              md5                sndhdr
                      UserString          datetime            mhlib              socket
                      _LWPCookieJar      dbexts              mime                sre
                      _MozillaCookieJar  decimal            mimetools          sre_compile
                      _builtin_        difflib            mimetypes          sre_constants
                      _future_          dircache            mimify              sre_parse
                      _abcoll            dis                modjy              ssl
                      _ast                distutils          multifile          stat
                      _codecs            doctest            mutex              string
                      _collections        dom                netrc              struct
                      _csv                dumbdbm            new                subprocess
                      _fsum              dummy_thread        nntplib            symbol
                      _functools          dummy_threading    nt                  synchronize
                      _google_ipaddr_r234 easy_install        ntpath              sys
                      _hashlib            email              nturl2path          sysconfig
                      _io                encodings          numbers            tabnanny
                      _jyio              errno              opcode              tarfile
                      _marshal            etree              operator            telnetlib
                      _py_compile        exceptions          optparse            tempfile
                      _pyio              filecmp            os                  test
                      _random            fileinput          parsers            tests
                      _rawffi            fnmatch            pawt                textwrap
                      _sre                formatter          pdb                this
                      _strptime          fpformat            pickle              thread
                      _systemrestart      fractions          pickletools        threading
                      _threading          ftplib              pipes              time
                      _threading_local    functools          pkg_resources      timeit
                      _warnings          future_builtins    pkgutil            token
                      _weakref            gc                  platform            tokenize
                      _weakrefset        genericpath        plistlib            trace
                      abc                getopt              popen2              traceback
                      aifc                getpass            poplib              tty
                      anydbm              gettext            posixfile          types
                      argparse            glob                posixpath          ucnhash
                      array              grp                pprint              unicodedata
                      ast                gzip                profile            unittest
                      asynchat            hashlib            pstats              urllib
                      asyncore            heapq              pty                urllib2
                      atexit              hmac                pwd                urlparse
                      base64              htmlentitydefs      py_compile          user
                      bdb                htmllib            pycimport          uu
                      binascii            httplib            pyclbr              uuid
                      binhex              ihooks              pydoc              warnings
                      bisect              imaplib            pyexpat            weakref
                      bz2                imghdr              quopri              whichdb
                      cPickle            imp                random              wsgiref
                      cStringIO          importlib          re                  xdrlib
                      calendar            inspect            readline            xlrd
                      cgi                io                  repr                xml
                      cgitb              isql                rfc822              xmllib
                      chunk              itertools          rlcompleter        xmlrpclib
                      cmath              jarray              robotparser        zipfile
                      cmd                javapath            runpy              zipimport
                      code                javashell          sax                zlib

                      Enter any module name to get more help.  Or, type "modules spam" to search
                      for modules whose descriptions contain the word "spam".

                      help>

                      I will continue testing this good tool...

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      Powered by NodeBB Contributors
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups