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. Support
  3. Agent 1.0.13 Windows 2000 - .Bat results to server

Agent 1.0.13 Windows 2000 - .Bat results to server

Scheduled Pinned Locked Moved Support
5 Posts 2 Posters 57.6k 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.
  • M
    M
    MitchW
    wrote on last edited by
    #1

    Hello,

    We are running NetXMS on a lot of our systems which are windows XP, Windows 7 and Windows Server 201x. The agent is running perfect on those systems and we created some specific powershell scripts which allows us to monitor specific service states and more.

    We also have a lot of Windows 2000 systems on which we do not have installed the agent yet. This is what i'm currently testing, and we noticed that version 1.0.13 is still compatible with windows 2000. I installed this agent without any problem and our NetXMS server can "talk" with this system.

    The problem I have now is that I want to create specific .bat files which check if a service is still running on the Windows 2000 system.
    I have created the following .bat for this:

    @ECHO OFF
    sc query NetXMSAgentdw32 | find "RUNNING"
    sc query NetXMSAgentdw32 | find "STOPPED"
    

    and the .bat file returns the following:
    STATE : 4 RUNNING

    I would like to have this value to be returned in our NetXMS server so that I can set alarm thresholds.
    I have changed the nxagentd.conf as follow:

    ExternalParameter=Test:"Start C:\PROGRA~1\Scripts\test.bat"

    Then I added the test to our Data Collection Configuration (See attachment).
    But this returns an ERROR (See other attachment).
    We would like / expect to have the result from the Batch inside of the Value so that we can set thresholds on this value.

    Normally we use Powershell which works perfect. But we can't use that on the Windows 2000 systems since they don't support Powershell..

    Is there a way to get the result from the .bat into our value field / did I make any mistakes in the nxagentd.conf?

    -Mitch


    Data Collection.png

    result.png

    1 Reply Last reply
    0
    • F
      F
      Filipp Sudanov
      wrote on last edited by
      #2

      ExternalParameter is able to search in path, but requires exact executable name with extension. On the contrary, ExternalParameterShellExec calls shell and shell is able to find an executable even without extension (but I am not sure, if it is present in 1.0.13).

      1 Reply Last reply
      0
      • M
        M
        MitchW
        wrote on last edited by
        #3

        Hi Filipp,

        I don't think the ExternalParameterShellExec is compatible with Windows 2000. As soon as I add this to my agent config, the Server shows: Error
        However the ExternalParameter should work as it is right now or not? Because the full path to the .bat file is mentioned in the config.

        1 Reply Last reply
        0
        • F
          F
          Filipp Sudanov
          wrote on last edited by
          #4

          The thing is that the .bat file is not an executable as such, it's being executed by cmd.exe. And ExternalParameter needs an actual executable.
          Running cmd.exe /C <your_bat_file> should probably to the job.

          1 Reply Last reply
          0
          • M
            M
            MitchW
            wrote on last edited by
            #5

            This did the trick!

            I changed my config to: ExternalParameter=Test:"cmd.exe "/C C:\PROGRA~1\Scripts\test.bat"" and now I have the result in my NetXMS Server 🙂

            Thanks!


            server.png

            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