$node.ipAddr is unspec
-
I have made a filter script that writes a DiscoveredNode object to a text document, code: $node.ipAddr. But the "unspec" text is written to the file.
I made this script just to understand how the filter script works.
If I don't use a script, everything works. So there is no problem in the search. Why is the IP address of the object not written, but the text unspec? -
Something like this was fixed recently, please try v5.2.1
-
I've updated to the latest version. Unfortunately now nothing is being written. I tried to do a clean install of NetXMS and the result is the same.
-
What is the name of the hook script that you are using?
-
I use a custom script where I write the state of a variable to a file. I don't use the built-in hook script.
-
From which place do you run your script?
-
Script is in script library and I select this script for discovery filter.
-
Yes, thanks for the info. In that script we have $node variable which contains object of DiscoveredNode class, please see here:
https://netxms.org/documentation/nxsl-latest/#class-discoverednodeWe will improve the UI in a future version so that discovery filter script is editable right from Network Discovery page with hint on available variables in that editor.
-
I use exactly this $node variable in the script and write its ipAddr property to a file. In the old version the UNSPEC text was written to the file and in the latest version nothing was written. Same for the other variables of the $node object (DiscoveredNode).
-
Can you show full script that does writing to file?
-
function main()
{
LogFile = IO::OpenFile("C:\\nx\\netxms.txt", "a");
if (LogFile != null)
{
LogFile.writeLine($node.ipAddr);
LogFile.close();
}
}
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