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:
1. you should place your code within main() function or not use functions at all;
2. If this is threshold violation event, then instance will be passed as event's parameter #6, and can be accessed as $event->parameters[6]
3. 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
Thanks !! ;D