Запуск скрипта, версия 4.5.6 (ошибка T_IDENTIFIER)
-
Я видимо туплю, как запускать скрипты
Взял скрипт примера тут
https://wiki.netxms.org/wiki/Using_nxshell_to_automate_bulk_operations#List_Inventory_Software_for_all_nodesfor node in [o for o in s.getAllObjects() if isinstance(o, objects.Node)]: print 'Node: ', node.getObjectName() try: for package in s.getNodeSoftwarePackages(node.getObjectId()): print package.getName() except: print "No package found"А у меня лезет ошибка сразу
line 1 T_IDENTIFIER expecting '('Буду очень благодарен, если поможете со скриптом, который у всех нод в контейнере поставит галки
Disable SSH...
Disable configuration pulling
Disable routing...
Disable topology...
Disable network discovery
-
-
Этот скрипт из вики расчитан на запуск при помощи nxshell (python).
Execute script в консоли запускает nxsl скрипты.Из NXSL можно отключить таким скриптом:
$node->enableSsh(false); $node->enableConfigurationPolling(false); $node->enableRoutingTablePolling(false); $node->enableTopologyPolling(false); $node->enableDiscoveryPolling(false);Можно запустить на ноде, или добавить в Hook::ConfigurationPoll.
Ну или можно обойти ноды скриптом:
for (n : GetAllNodes()) { n->enableSsh(false); n->enableConfigurationPolling(false); n->enableRoutingTablePolling(false); n->enableTopologyPolling(false); n->enableDiscoveryPolling(false); } -
-
дефолтные настройки изменить нельзя, так как они жестко закодированы. Есть Hook::ConfigurationPoll скрипт где вы можете добавить следующее
if (classof($object) == "Node") {
$node->enableConfigurationPolling(false);
}Первый раз после создания noda будет запущен Configurstion poll, а затем он будет отключен.
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