Temporarily suppress alarms in xMatters

Not Yet Reviewed

Is it possible to temporarily suppress alarms in xMatters during a scheduled service window so as to avoid alarms being sent to those on-duty?

Surveillance tools such as Nagios implements the concept of putting servers in "Outage" so as to suppress any alarms and ensure downtime doesn't count against availability.

0

Comments

5 comments
Date Votes

Please sign in to leave a comment.

  • I suspect it is possible to accomplish this either through some flood control settings and/or disabling the workflow the alarms go through during the scheduled service window, or through a custom flow step and script. I'm sure there are other ways this could be done too.

    Scheduling the suppression to take place rather than actively disabling and enabling it would probably require a script somewhere though, be it in a custom flow step or something you run to tell xMatters to turn if off and on.

    0
  • Thanks Sean,

    What I'm looking for is to tell xMatters to suppress alerts for a specific time window.
    I don't want to simply turn alerts off as I then risk "someone" forgetting to turn them back on afterwards.

    Sounds like suppression by scripting a custom step would be the best approach, not certain where to start with that endeavour though?

    0
  • Here is an example. The code is similar for use in a custom step vs the inbound integration. Check the comments for some notes.

    // Grab the moment shared library
    var moment = require( 'moment' );
    require( 'moment-timezone' );

    // Grab the current time and mark it as Pacific time
    var currentTime = moment.tz( moment(), "America/Los_Angeles");

    console.log( 'Now: ' + currentTime.format() );

    // We want this to compare every day, not a specific day, and
    // I think moment needs the year, month, day values.
    var extra = moment().format( 'YYYY-MM-DD' ) + ' ';
    var start = moment.tz( extra + '10:00', "America/Los_Angeles" );
    var end = moment.tz( extra + '10:15', "America/Los_Angeles" );


    console.log( 'start: ' + start.format() );
    console.log( 'end: ' + end.format() );

    // this 'output' syntax is for flow designer. IB script syntax below
    output['continue'] = !( currentTime.isBetween( start, end ) && (
    input['HostName'] == 'myserver1' ||
    input['HostName'] == 'myserver2' ) );

    // IB syntax. Don't use this if in flow designer.
    // Assuming here that the incoming payload is
    // stored as `data`
    var continue = !( currentTime.isBetween( start, end ) && (
    data['HostName'] == 'myserver1' ||
    data['HostName'] == 'myserver2' ) );
    if( !continue ) {
    console.log( 'Skipping daily check for "' + data['HostName'] + '"' );
    return;
    }

     

    0
  • I'm guessing that Jonathan probably either doesn't have access to or does not want to modify the sending system to include a value while the maintenance window is going on (I could be mistaken though), so I thought about how you might put something time specific on the xMatters side and came up with the below; where you'd change what is currently writing to the console to do something different depending on if it is in or outside your window. Word of caution that the start and end dates you entered have to be in UTC (I didn't feel like doing anything to try and account for local time zone):

     

     

    var startDate = new Date('10/30/2019 11:10:10'); //start of service window, UTC
    var endDate = new Date('10/30/2019 22:30:00'); //end of service window, UTC

    currentDate = new Date() //get current date and time
     

    //check if the current date and time are inside the service window
    if(startDate < currentDate && endDate > currentDate){ 
        console.log("It is currently inside the service window")
    } else{
        console.log("It is currently outside the service window")
    }
    0
  • Ahh, and I see Travis' latest comment does include accounting for the timezone! So if I were to do this i'd probably go with that so I wouldn't have to convert it from UTC myself.

    0

Didn't find what you were looking for?

New post