Notes
![]() ![]() Notes - notes.io |
Date currentDate = new Date()
def outputFormat = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
String formattedDate = outputFormat.format(currentDate)
def sdf = new java.text.SimpleDateFormat("dd-MM-yyyy")
def dt = sdf.format(currentDate)
def flagError = false
def ArrayList = []
def log = ""
def detaildb
def sendmail
// Fetch queue and recipient email dynamically
def r_desc = RefDataQuery.from("MFDMINTK_4489").select("value").where(RefDataCriteria.exp("key").equalTo("queu")).execute();
def queu = r_desc.get(0).value;
def r_des = RefDataQuery.from("MFDMINTK_4489").select("value").where(RefDataCriteria.exp("key").equalTo("to")).execute();
def to = r_des.get(0).value;
// Initialize node entities
Map<String, Object> attrMap1 = new HashMap<>()
attrMap1.put("HostName", "dlap-w2intg0110")
Set<String> nodeLabels1 = new HashSet<>()
nodeLabels1.add("Linux")
// Get the node entity instance
def nodeEntityInstance1 = ceb.get(nodeLabels1, attrMap1)
def node1 = ceb.get(nodeEntityInstance1.getId(), nodeLabels1)
Map<String, Object> attrMap2 = new HashMap<>()
Set<String> nodeLabels2 = new HashSet<>()
attrMap2.clear()
nodeLabels2.clear()
attrMap2.put("HostName", "dwa-w01ignio02")
nodeLabels2.add("Windows")
def nodeEntityInstance2 = ceb.get(nodeLabels2, attrMap2)
ProxyNode = ceb.get(nodeEntityInstance2.getId(), nodeLabels2)
// Loop to process all 150 rows from the Datatest_4489 table
for (int i = 1; i <= 150; i++) {
def result = RefDataQuery.from("Datatest_4489")
.select("servername", "serverlog", "wrapperlog")
.where(RefDataCriteria.exp("row_number").equalTo(i)) // Assuming row_number identifies the rows uniquely
.execute();
if (result.isEmpty()) {
log += "<br>> No data found for row ${i}, skipping."
continue
}
def server = result.get(0).servername
def job1 = result.get(0).serverlog
def job2 = result.get(0).wrapperlog
// Call the Serwar_4489 method and check for errors
def keycheck = subject.Serwar_4489(server: job1, wrapper: job2)
if (keycheck.outputStream.contains("SocketTimeoutException")) { ArrayList.add("SocketTimeoutException") }
if (keycheck.outputStream.contains("ResourceUnavailableException")) { ArrayList.add("ResourceUnavailableException") }
if (keycheck.outputStream.contains("Channel is full")) { ArrayList.add("Channel is full") }
if (keycheck.outputStream.contains("SSLHandshakeException")) { ArrayList.add("SSLHandshakeException") }
// Process each error found
for (error in ArrayList) {
def Abc = "" + server + " | " + error + ". "
def S1 = "" + server + " | " + formattedDate + " | " + error + " | Error "
// Incident handling
def IncStatus = subject.CheckINC_4489(summary: Abc, queue: queu)
if (IncStatus.outputStream.contains("Incident present with status")) {
log += "<br>> Incident already present for server: ${server}, skipping."
continue
} else {
log += "<br>> Creating new incident for server: ${server}."
def incCreate = ProxyNode.RXR_Incident_3916(
UsecaseName: "MFDM_4489",
UsecaseOutput: "Incident has been created",
UCNotes: S1,
UCSummary: Abc,
Impact: "3-Moderate/Limited",
Urgency: "3-Medium"
);
if (incCreate.returnCode != 0) {
def MailLog3 = "Hi team,n<br>Ignio is not able to create INC for the server (${server}).n<br>Check Wrapper Logs-SAG Daily Incident report.n<br><br>Thanks, Ignio"
def subject3 = "Incident creation failed for Wrapper Logs (${dt})"
sendmail = iAction.Collaboration.SendMail(Body: MailLog3, Subject: subject3, To: to)
log += "<br>> Unable to create incident for server: ${server}."
} else {
def incidentnumber = incCreate.outputStream.split(":")[1].split(",")[0].trim()
detaildb = subject.Incdetailsdb_4489(Incident: incidentnumber, Description: S1, Queue: queu, Server: server)
log += "<br>> Incident created successfully for server: ${server}."
}
}
}
}
// Final log output
outputMap.errorStream = log
outputMap.returnCode = 0
return 0
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team