Event Management CI which are not operetional

George18
Tera Expert

Hi,

Is there a way to exclude events from CIs which are not operational, or which are not found in the CMDB?

 

Thanks

3 REPLIES 3

Amit Gujarathi
Giga Sage
Giga Sage

HI @George18 ,
I trust you are doing great.
Please find the code that may help you.

(function processEvent(event) {
    var ciSysId = event.getValue('cmdb_ci');
    var ci = new GlideRecord('cmdb_ci');

    if (ci.get(ciSysId)) {
        // Check if the CI is operational
        if (ci.operational_status.getDisplayValue() != 'Operational') {
            event.ignore();
            return;
        }
    } else {
        // CI not found in CMDB
        event.ignore();
        return;
    }

    // Process event normally if CI is operational and exists in CMDB
    // Your event processing logic here
})(current);

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



Hi Amit, thank you for your reply. In which location do I put this code?

Sorry, I am still trying to learn the whole SNOW platform.

 

Can I also check based on a metric name of the event?

 

Thanks again

Rahul Priyadars
Giga Sage
Giga Sage

Hi George 

 

One small Input - By Process if a Ci is not operational in CMDB then how its still getting Monitored by Monitoring Tool?

 

On your Second Point- If a CI is not found in CMDB still alert will be Created with Node value but it will not be binded with CI Value in Alert Table.

 

RahulPriyadars_0-1701149645707.png

 

Configuration Item Field will be empty when CI is not found in CMDB - Its OOTB

 

 

Regards

rP