Create agent list for instance discovery?
-
I need to monitor a value that can be extracted from a database on a database server. This is easy to do with a DCI that uses a custom shell script that queries the database for the value to be monitored.
However, the database server has, in fact, not one but approximately 60 databases. Each database has the same schema, so the same script can be used to monitor the value in question for each database. But I do not want to create 60 different DCIs manually, one for each database to be monitored. I would rather use instance discovery so that they can be created automagically for me.
However, in order to use instance discovery for this case, it would appear to be necessary to do two things:
- Create a DCI based on my shell script that contains an {instance} parameter that accepts the name of a database on the server.
- Create an agent list that contains the names of all of the databases on the database server.
Are both of these things possible? I am new to NetXMS and so far I have only come across built-in DCIs that accept {instance} parameters, as well as only pre-defined agent lists. I would be willing to code something up in Java, but I would need a few pointers on how to get started.
I would appreciate any help to point me in the right direction, even if the answer is that this is not possible.
-
Hi!
You can create your own list on agent using ExternalList configuration option. Agent will execute command given and return all it's output as list elements. For example, to add list which will return all files in /tmp, add the following to nxagentd.conf:
ExternalList = TemporaryFiles:/bin/ls /tmpBest regards,
Victor -
@victor said in Create agent list for instance discovery?:
You can create your own list on agent using ExternalList configuration option. Agent will execute command given and return all it's output as list elements. For example, to add list which will return all files in /tmp, add the following to nxagentd.conf:
ExternalList = TemporaryFiles:/bin/ls /tmpBingo! It works like a charm. Thank you very much.
Is "ExternalList" documented somewhere? It is not that I need more info, but I have not seen documentation that mentions this parameter and neither did a web search find anything. I would love to read more documentation, even if it were just source code.
-
We implement it just recently, in 1.2.12, and it is not documented yet.
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