gavsto/AutomateAPI

Internal monitor lookup fails

Closed this issue · 4 comments

We have seen this in one or two environments in testing and believe it is due to a bug in the API. If you get this and are willing to test then please contact me directly.

This is definitely an issue with Automate. Loading automate/browse/companies/monitoring/internal-monitors in the new web app also fails to load.

Thanks to @JohnDuprey on Slack we've managed to Isolate the problem with the API. Though it's not a problem with this module I am outlining the fix here to help.

In C:\windows\temp\_automatelogs\ you will have a number of Automate API logs. Log on to https://yoururl/automate, and trigger the error by going to Internal monitors and seeing the unhandled exception. Find the latest log, open it, go to the bottom and find the error that looks like:

"ERROR_MESSAGE="Duplicate entry '9561-30' for key 'PRIMARY'""

9561 refers to an Internal Monitor. You can figure out which one by running this in SQL:

SELECT NAME FROM agents WHERE agentid = 9561

The error triggers when there is a parent/child group attached to the monitors that is invalid.

image

Open the Internal monitor and go to the monitor target tab. You can see in this Screenshot that there is Service Plans.Windows Servers (not a valid group to target as it's a placeholder group) and then sub groups of that group. The same goes for Service Plans.Windows Workstations. Remove both of those entries from Monitor Target and it should fix the problem.

I had this problem. Your fix worked for me.

Issue is not related to the module.