acknowledge and terminate alarms using third party software

Started by doubled, July 25, 2019, 05:05:24 PM

Previous topic - Next topic

doubled

I'm very new to the product so my knowledge is limited. The person who installed and maintained the netxms environment has left so I need to figure it out by myself and this community.
This forum helped me a lot already but I have one problem I cannot solve.

Nobody is monitoring the alarms from the management console, all relevant alarms are emailed and managed from there. This means that alarms are never acknowledged, resolved or terminated. It seems that the housekeeper is not clearing alarms that still hold the status outstanding even if it passes the set expiration period.

Now SQL scripts are developed that alter alerts directly in the database. All alerts are being set to "Acknowledged" within 5 minutes and set to "terminated" in an hour. The NETXMS source code has been used to figure out which fields in the database needed to be altered.

But the management console does not update the alert when the status has been updated. Not even when you restart the console. Only when you restart the Server itself the console will show the at that time correct status. This means that the scripts work correct. It seems that the server has a local copy of the alarm administration and uses that to inform the clients. Off course it is updating in the database.

Now the question how can i force the server to always use the content from the database instead of the local copy in memory?

tomaskir

You should never manipulate the data directly in the database.

Your options are:
1) use NXSL to manipulate the alarms
2) use the API to manipulate the alarms

For the API, you can either use nxshell, or write a custom application using the Java API libraries.

nxshell has documentation on the wiki:
https://wiki.netxms.org/wiki/Using_nxshell_to_automate_bulk_operations

paul

My 2 cents as a novice user.

tomaskir is right but possibly too blunt. I think what he meant to say was that unless you use the proper access mechanisms supplied for use with NetXMS, you cannot expect to get the same results.

From a console performance perspective, NetXMS I expect is designed to deliver its performance using caching and only by using the proper mechanisms can you expect that things like server cache will reflect any updates you apply.

I am not surprised that the console / server have a discrepancy, but, there is simply no options available as there is nothing that is broken or not working as designed.

Other than trying the web console vs. the management console, there are not a lot of "official" options - in fact - none.

Basically, once the decision was made to alter the database directly, you created your own customized version. Having done so, you appear now to be asking how to make further customizations to get the console working in you customized installation. Your problem is not that the console will not display - your problem is that the customizations that write to the database directly are causing problems. Solution is simple - get rid of them and use what is there already.

My suggestion - similar to tomaskir - step back from the customization by rewriting your SQL that update the database directly into NXSL or to use the API.

Either of these will then update NetXMS DB using the correct method, allowing the console to work and display properly - as per your original intent.

Probably about 20 - 30 lines of NXSL - add as a scheduled task - run it every 5 minutes.

For each Alarm where createtime = current time - 5 minutes - set to acknowledged.
For each Alarm where createtime = current time - 1 hour - set to terminated.

Achieves all that you are attempting to achieve without affecting the automation that emails out the alerts AND gives you a console that is updating.


doubled

Thank you both for the answers. The answers are not the one's I was hoping for but I understand that there is no server DB reload or refresh option that can be triggered. I need will have a look at the suggestion to create a script I want to put minimum effort in it as we are migration to another tool and it will be obsolete in the near future.

Victor Kirhenshtein

Hi,

you can also use nxalarm command line tool for acknowledge and terminate alarms.

Best regards,
Victor

paul

Rather interestingly, I migrated from four "big name" other NMS solutions to NetXMS.

Today we had a major power spike across the metro area - ORION - asleep at the wheel, overloaded by bloated functions, NetXMS - my Up/Down dashboard - 1 minute auto refresh - loved by all.

NetXMS has its nuances, but for us, today demonstrated that NetXMS can easy hold its own, and more, for standard NMS and SNMP based monitoring.