2 Replies Latest reply on Apr 28, 2018 11:21 PM by mesverrum

    What SQL command to check all alerts which are mapped across the node?

    er.vansh17091

      What SQL process to check all alerts which are mapped to the node? let's assume, we have 5 nodes & I don't know how many alerts are mapped to all 5 nodes so how can we check what kind of alerts are configured over the nodes. Please share the SQL or any script through which I can check.

          • Re: What SQL command to check all alerts which are mapped across the node?
            mesverrum

            There is no simple way to figure it out that i have ever seen posted.  Since Orion doesn't associate alerts specifically with objects there is not some master table of nodes that match each alert. The closest thing to an easy answer to this is the "all alerts this object can trigger" resource, but I've not seen a way to view that as a report. Looking at the aspx for that resource it seems to make a call against /api/AllAlertThisObjectCanTrigger/GetAlerts, if you were fancy you could rig something up with powershells that runs through the list of every object in your environment and hits that api to see all the alerts, but whatever logic they are using has limits because I often find that the resource doesn't include all of my alerts. I would be a little resistant to doing all that work to make a report from a source that I know is not 100% accurate to begin with.

             

            <script type="text/javascript">

                        $(function() {

                            SW.Core.Resources.ActiveAlerts.SortablePageableTable.initialize(

                            {

                                uniqueId: '<%= Resource.ID %>',

                                pageableDataTableProvider: function(pageIndex, pageSize, onSuccess, onError) {

                                    var uniqueId = '<%= Resource.ID %>';

                                    var currentOrderBy = $('#OrderBy-' + uniqueId).val();

                                    var eName = '<%= this.EntityName%>';

                                    var eUri = '<%=this.EntityUri%>';

                                    SW.Core.Services.callController("/api/AllAlertThisObjectCanTrigger/GetAlerts",

                                    {

                                        AlertDefId: 1,

                                        EntityName: eName,

                                        TriggeringObjectEntityUri: eUri,

                                        CurrentPageIndex: pageIndex,

                                        PageSize: pageSize,

                                        OrderByClause: currentOrderBy

                                    }, function(result) {

                                        onSuccess(result);

                                        $resourceWrapperTitle = $("div.ResourceWrapper[resourceid=<%= Resource.ID %>] h1:first");

                                        if ($resourceWrapperTitle.find("span").length == 0)

                                        {

                                            $resourceWrapperTitle.append(SW.Core.String.Format("<span><%= Resources.CoreWebContent.WEBDATA_PS0_104 %></span>", result.TotalRows));

                                        }

                                        else

                                        {

                                            $resourceWrapperTitle.find("span").text(SW.Core.String.Format("<%= Resources.CoreWebContent.WEBDATA_PS0_104 %>", result.TotalRows));

                                        }

                                    }, function(errorResult) {

                                        onError(errorResult);

                                    });

                                },

             

             

                                initialPage: 0,

                                rowsPerPage: '<%= (Resource.Properties["RowsPerPage"] != null) ? Convert.ToString(Resource.Properties["RowsPerPage"]) : "5" %>',

                                allowSort: false,

                                columnSettings: {

                                    "AlertName": {

                                        isHidden: false,

                                        caption: "<%= Resources.CoreWebContent.WEBDATA_PS0_154 %>".toUpperCase()

                                    },

                                    "Description": {

                                        isHidden: false,

                                        caption: "<%= Resources.CoreWebContent.WEBDATA_PS0_155 %>".toUpperCase()

                                    },

                                    "Severity": {

                                        isHidden: false,

                                        caption: "<%= Resources.CoreWebContent.WEBDATA_PS0_156 %>".toUpperCase()

                                    }

                                    <%= CustomPropertiesColumnSettings %>

                                }

                            });

             

             

                            var refresh = function() { SW.Core.Resources.ActiveAlerts.SortablePageableTable.refresh(<%= Resource.ID %>); };

                            SW.Core.View.AddOnRefresh(refresh, '<%= SortablePageableTable.ClientID %>');

                            refresh();

                        });

                    </script>