Как посчитать количество Node в Container
-
-
Если они все живут непосредственно под этим контейнером (а не в подконтейнераз), то сделать в script library такой скрипт:
container = FindObject(1234); // 1234 - ID контейнера status_to_count = $ARGS[1]; count = 0; for (c : container->children) { if (classof(c) == "Node") { if (status_to_count == -1 or c->status == status_to_count) count++; } } return count;В качестве параметра скрипту подается число
0 Normal 1 Warning 2 Minor 3 Major 4 Critical или -1 - считать все ноды.
Ну и дальше на какой-нибудь ноде (для этих целей можно создать фиктивную ноду с адресом 0.0.0.0) сделать скриптовые DCI которые вызвают этот скрипт из библиотеки.
-
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