Send different DCI values from the same node (or not?)
-
Hello,
I'm generating an event when disk space is low -> no problem.
I generate a Treshold when FileSystemFreePerc < 10%.
On the message field of Event configuration I write: "Low disk space of %n : %4 %% (limit %3 %%)" and then send it by mail.But how can I send the value of another parameter like FileSystem.Total of the same node? (or of another? I see that each parameter have ID).
Regards
-
Hi,
you can use scripts for that. You can insert return value of script from script library using %[script_name] macro, and in a script you can use AgentReadParameter to read data directly from agent or GetDCIValueByName/GetDCIValueByDescription to get value of another DCI.
Best regards,
Victor -
Thanks for the reply,
I've done:
sub Free() { value = AgentReadParameter($node, "FileSystem.Free(" . $1 . ")"); return (value != null) && (value > 0); }In a script library.
(I wanted that the script work on the actual "instance" letter Drive, is that possible?)
Then, in event message "%[NameInTheLibrary]" doesn't work.
-
Hi,
there are few errors:
- you should place your code within main() function or not use functions at all;
- If this is threshold violation event, then instance will be passed as event's parameter #6, and can be accessed as $event->parameters[6]
- Expression
return (value != null) && (value > 0);
will return 0 (false) or 1 (true) which is probably not what you want.
Script that will return value of FileSystem.Free for current instance or N/A if it cannot be obtained can looks like following:
value = AgentReadParameter($node, "FileSystem.Free(" . $event->parameters[6] . ")"); return (value != null) ? value : "N/A";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