GetDCI
-
Hi,
I was wondering whether i can achieve this or not:
I have dci's who shows free disk space and dci's who shows total disk space. For one node there are more than one disk.
What i want is, when alarm ir raised from free disk space threshold, i want to pass the total disk value to event too.
I can achieve this with script:return GetDCIValue($node, FindDCIByName($node, "Filesystem.Total(C:)"));
but this is for one dci with disk C.
So is there a way to use this one script or event for more than one disk, or I must create new script and event for each disk?Regards,
Nikk -
Hi!
In the script you have access to DCI's "instance" field (via $event->instance). If you have correct disk name in that field (and it will be populated automatically if DCI in question was created by instance discovery) you can form correct DCI name for FindDCIByName.
Best regards,
Victor -
Thanks for solution!
So I tried it, stumpled upon instance discovery filter script. I wanted to get only C and D disks.
I tried this script:if (substr($1,1,1) = "C") || (substr($1,1,1) = "D")
{
return true;
}
else
{
return false;
}Seems like i don't get something, please guide me to right path

Nikk
-
Looks like typo - you use = instead of == for comparison.
Best regards,
Victor -
-
Anyway, i'm still getting the other disks (see 1. screen), maybe the script isn't right.
Then i tried your script:
value = AgentReadParameter($node, "FileSystem.Total(" . $1 . ")");
return (value != null) && (value > 0);And get rid only of Disk A:, but no disk E: (see 2. screen).


-
Script looks correct. Could it be that disk E: has non-zero total space (could be the case if this is CD drive with disk inserted or any other read-only device)?
Best regards,
Victor -
-
You can query FileSystem.Total(E:) using nxget to check it.
Best regards,
Victor -
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