Automatic Config of new objects
-
That helps a ton. One final question. If I want a template to automatically apply a service check against a server (custom port 80 or http check for example) how would I put that in? Would I just use localhost and port 80?
ServiceCheck.Custom(localhost,80) with threshold >= 1
Sorry if these sound like horribly newbie questions.
-
If you want to check the website from the agent running on that node, then yes.
(that is not very useful tho, because it may run locally, but may not run remotely)So usually, you want to check from the NetXMS server.
Here you would set "Source node" to the NetXMS server.Assuming you are binding from the template then, you would set the DCI parameter as:
ServiceCheck.Custom(%{node_primary_ip},80)This will replace the %{node_primary_ip} macro in each DCI for the IP address of the node the DCI is bound to.
https://wiki.netxms.org/wiki/UM:Data_Collection#Macros_in_template_itemsAs a last note, I recommend doing ServiceCheck.HTTP rather than ServiceCheck.Custom, since it will actually check the website returned.
Documentation here: https://wiki.netxms.org/wiki/Subagent:PortCheck -
Ok, then how would I get it to automatically apply to the netxms server? Does just returning true in the script add the template to the netxms server and $node adds it to the newly added node?
-
-
Perfect. I think that's all I need at this point. Really appreciate the assistance.
-
nm, definitely got more questions.
So, using your above code, I have a server that has IIS installed. Ideally, I'd look for the open port or a service on the box. In this case, the service is w3wp.exe, the iis service. I'd like the template to apply once the node is added, add the template to the netxms server, and automatically monitor the new node for port 80
Auto Apply rule would be this:
searchProcess = "w3wp.exe"; procArray = AgentReadList($node, "System.ProcessList"); if (procArray == null) return false; foreach (process : procArray) { if (index(process, searchProcess) != 0) return $node->isLocalMgmt; } return false;and dci paramater would be ServiceCheck.Custom(%{node_primary_ip},80) (I'm just doing the custom port for simplicity atm, I'll be adding in the http later).
Not working obviously.
-
-
no, I want to check the node to see if it has the service running, then apply a monitor to the netxms server to monitor against the node for port 80
-
Your auto-bind script will be
searchProcess = "w3wp.exe"; procArray = AgentReadList($node, "System.ProcessList"); if (procArray == null) return false; foreach (process : procArray) { if (index(process, searchProcess) != 0) return true; } return false;On the DCI, the parameter will be:
ServiceCheck.Custom(%{node_primary_ip},80)Make sure to set "Source node" in the DCI configuration to the NetXMS server.
The template will be bound to the node running the IIS server, not to the NetXMS server.
(since the NetXMS server is not the one offering the HTTP service, the DCI should not be on the NetXMS server)The service check will be performed from the NetXMS server to the IIS node tho.
(that is what the "Source node" setting configures) -
Ok, perfect. Thanks again for the help.
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