use dynamic IP from SNMPget to PING by subagent icmp.ping
-
yes but its not the WAN IP address (which I could get from resolved DDNS name), it's the default gateway address of the WAN subnet. I can get the default gateway IP address from the local routing table by SNMP, thats not the problem. But than I have to 'ping' this IP from the NetXMS server.
-
Hi!
Solution #1 seems correct. You can get value from remote agent with AgentReadParameter function. However, easier would be to use proxy node directly:
On GATEWAY1 a DCI: Origin = Agent, Parameter = Icmp.Ping(ip), Proxy-node = NetXMS-server
No transformation script needed in this case.
Best regards,
Victor -
-
Sorry, I misunderstood the situation. Then you can use the following DCI:
Origin = SNMP, Parameter = OID you are using to get IP address
with the following transformation script:
server = FindNodeObject($node, "netxms-server-name"); return AgentReadParameter(server, "Icmp.Ping(" . $1 . ")");Best regards,
Victor -
Hi Victor
Many thanks for the very fast solution. It works
The following line is the solution:
return AgentReadParameter(server, "Icmp.Ping(" . $1 . ")"); [I didn't know that]But can you explain me the syntax you used 'icmp.ping(" . $1 . ")?
From SubAgent documentation I have this syntax 'Icmp.Ping(target,*timeout*,*psize*)'thanks a lot!
Dani
-
-
sorry last post was too early

I changed the Data Type of the DCI to integer and now it's ok. I thought the Data Type must be the type of the SNMP value. But it looks like Data Type is the type of the DCI-result after the transformation script.
So only the question about the icmp.ping syntax is open. -
Timeout and packet size are optional arguments and can be omitted. There is word "optional" deep in parameter description
All following forms are valid:Icmp.Ping(10.10.10.1)
Icmp.Ping(10.10.10.1,3000)
Icmp.Ping(10.10.10.1,2000,120)
Icmp.Ping(10.10.10.1,,140)Best regards,
Victor -
-
. is string concatenation operation in NXSL. NXSL does not do macro expansion within strings, so you have to do concatenation. Don't be confused by $ sign - it is valid character in identifiers and has not any special meaning. It's just a naming convention to start names of built-in variables with $. You can name your variable a$ for example.
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
thanks!