- To deploy a custom SQLexecutor package, copy the custom-sql-executor.jar file in the <Applicare_home>/ext directory. If it doesn't exist, create it.
- Create a SQLProperty.props file in the same location as the custom-sql-executor.jar file.
- Set the custom SQL in the SQLProperty.props file, using the form of a key-value method. For example:
serverCount=select count(*) from server
- You are able to set more than one SQL query by giving a unique name for each SQL in the SQLProperty.props file.
- In the Applicare console, go to Menu->Tools->Remote Commands and click on the Setting icon to create a SQL remote command.
- In the form give the remote command a custom name and select the agent to choose the environment (agent) from which the SQL will execute.
- In the Command field give a command for custom SQL query execution in the format and field seen below:
java -jar C:\Applicare_mysql\ext\custom-sql-executor.jar serverCount
- Save the changes and click on the Run button to verify the output of your custom SQL command. You can also see the output of the remote command when you come back to the remote command home directory. If you receive an error, check the SQL command and steps mentioned above. The error's stack trace appears in the Standard Error tab.
- Once you receive a successful number value from the remote command executor, you can see the value in the Shell script MBean type of the respective server's MBean browser.
- Now you can add this MBean in the Sensor Analyzer.
Please sign in to leave a comment.