- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2014 10:37 AM
If i give the system a list of INC's is there a way to have it check if they are "anything other than 'Closed'" or "closed".
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2014 01:09 PM
This is how you can do it:
1. create an event called "u.nagios.incident.report" in the Event Registry
2. an Inbound Email Action that reads your incoming email. It's real simple, just firing an event with the Incident #s as a parameter and, if you have the "Ordered Email Processing" plugin installed, will stop further processing of the email:
Condition: email.subject.toLowerCase().indexOf("nagios incident report") > -1
Script:
(function(){
gs.eventQueue("u.nagios.incident.report", null, email.body_text, "");
event.state="stop_processing";
})();
3. an Email Notification that reports back on their status. It is a simple mail_script block that queries the Incidents (it assumes you are sending the Incident #'s in a comma separated format in the email message [eg. INC0000048,INC0000049])
<mail_script>
var gr = new GlideRecord("incident");
gr.addEncodedQuery("numberIN" + event.parm1);
gr.query();
while (gr.next()) {
template.print(gr.getValue("number") + " - " + gr.getDisplayValue("state") + "<br/>");
}
</mail_script>
You can obviously add whatever you need to the notification to pretty it up.
That will basically do the work for you, although you may have to tweak a few things to work in your particular environment. I've attached XML files of the 3 records you need if you want to import and play around with the solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2014 11:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2014 01:09 PM
This is how you can do it:
1. create an event called "u.nagios.incident.report" in the Event Registry
2. an Inbound Email Action that reads your incoming email. It's real simple, just firing an event with the Incident #s as a parameter and, if you have the "Ordered Email Processing" plugin installed, will stop further processing of the email:
Condition: email.subject.toLowerCase().indexOf("nagios incident report") > -1
Script:
(function(){
gs.eventQueue("u.nagios.incident.report", null, email.body_text, "");
event.state="stop_processing";
})();
3. an Email Notification that reports back on their status. It is a simple mail_script block that queries the Incidents (it assumes you are sending the Incident #'s in a comma separated format in the email message [eg. INC0000048,INC0000049])
<mail_script>
var gr = new GlideRecord("incident");
gr.addEncodedQuery("numberIN" + event.parm1);
gr.query();
while (gr.next()) {
template.print(gr.getValue("number") + " - " + gr.getDisplayValue("state") + "<br/>");
}
</mail_script>
You can obviously add whatever you need to the notification to pretty it up.
That will basically do the work for you, although you may have to tweak a few things to work in your particular environment. I've attached XML files of the 3 records you need if you want to import and play around with the solution.