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. Feature Requests
  3. Отключение агентов для новых нод

Отключение агентов для новых нод

Scheduled Pinned Locked Moved Feature Requests
russian
5 Posts 2 Posters 22.0k 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
    andrey--k
    wrote on last edited by
    #1

    У меня в сети не используются агенты.
    Можно ли добавить опцию для отключения агентов для всех новых нод?

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      С добавлением метода enableAgent можно повесить скрипт на SYS_NODE_ADDED и отключать агентов с его помощью.

      1 Reply Last reply
      0
      • A
        A
        andrey--k
        wrote on last edited by
        #3

        Столкнулся с проблемой передачи параметра в скрипт.

        Если в Actions Configuration:
        DisableAgentOnEvent - запускает скрипт без параметров. Действий не происходит.
        DisableAgentOnEvent(%I) - Не найден скрипт

        Node added
        [26-Mar-2014 11:22:15.913] [DEBUG] *actions* Executing action 1 (DisableAgentNodeAdded) of type NXSL SCRIPT
        [26-Mar-2014 11:22:15.913] [DEBUG] *actions* Executing NXSL script "DisableAgentOnEvent(8665)"
        [26-Mar-2014 11:22:15.913] [DEBUG] ExecuteActionScript(): Cannot find script DisableAgentOnEvent(8665)
        

        Из консоли тоже ошибка:

        $ nxadm -c "exec DisableAgentOnEvent(8647)"
        ERROR: Script "DisableAgentOnEvent(8647)" not found
        

        DisableAgentOnEvent %I - Не найден скрипт

        [26-Mar-2014 11:17:15.361] [DEBUG] *actions* Executing action 1 (DisableAgentNodeAdded) of type NXSL SCRIPT
        [26-Mar-2014 11:17:15.361] [DEBUG] *actions* Executing NXSL script "DisableAgentOnEvent 8658"
        [26-Mar-2014 11:17:15.361] [DEBUG] ExecuteActionScript(): Cannot find script DisableAgentOnEvent 8658
        

        Из консоли - работает

        nxadm -c "exec DisableAgentOnEvent 8647"
        INFO: Script finished with rc=0
        

        Как правильно привязать скрипт к event?


        EventProcessing.PNG

        Actions Configuration.PNG

        Script.PNG

        1 Reply Last reply
        0
        • V
          V
          Victor Kirhenshtein
          wrote on last edited by
          #4

          Если скрипт вызван из политики, то у него будут две переменных выставлены - $node и $event. Описания классов здесь: http://wiki.netxms.org/wiki/NXSL:Node и http://wiki.netxms.org/wiki/NXSL:Event.

          1 Reply Last reply
          0
          • A
            A
            andrey--k
            wrote on last edited by
            #5

            Спасибо!
            Все заработало.
            Скрипт:

            $node->enableAgent(false);
            
            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