Как подсчитать сумму DCI для трафика?
-
-
добавить еще один DCI с source=Script.
Скрипт примерно такой:v1=GetDCIValueByName($node, "TrafficDci1"); v2=GetDCIValueByName($node, "TrafficDci2"); v3=GetDCIValueByName($node, "TrafficDci3"); return v1 + v2 + v3;Или без скрипта в library - source=Internal, DCI=Dummy, скрипт прописать прямо в Transformation script.
-
-
https://wiki.netxms.org/wiki/NXSL:FindAllDCIs
Как-то так (код не проверял):
total = 0; dciList = FindAllDCIs($node, "System.CPU.Usage(*)"); foreach (dci : dciList) { total += GetDCIValue($node, dci->id); } return total; -
Выкрутился иначе. Создал два скрипта, один на входящий, второй на исходящий трафик. Ищу по полному названию DCI.
sub main() { // Search for node named "gateway" gw_node = FindObject($1); if (gw_node == null) return 0; // No such node or access denied // from here, gw_node can be used in a same way as $node, for example: v1 = GetDCIValue(gw_node, FindDCIByDescription(gw_node, "Inbound traffic on COMPANY1")); v2 = GetDCIValue(gw_node, FindDCIByDescription(gw_node, "Inbound traffic on COMPANY2")); tot = v1 + v2; if (tot > 0) return tot; else return 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