Re: [HELP] PyMIP Web Alarm List (aka. PyMIPWAL) Tips and Tricks for external URL triggering (356 Views)
Reply
Collector
KeijoDPutt
Posts: 2
Registered: ‎01-02-2012
Message 1 of 2 (412 Views)

[HELP] PyMIP Web Alarm List (aka. PyMIPWAL) Tips and Tricks for external URL triggering

[ Edited ]

Hello all,

 

Is there a way to make WAL Launch (from TeMIP's PyMIP Web Alarm List) to interpret content and pass it to a URL, even though it’s not exactly defined as such?

 

I've been doing some flight-hours over this technology, software originally from Data Ductus, which its version 1.2 is productive in our cluster environment.

 

Basic alarm monitoring and interaction is pretty much acceptable, aside from poor and outdated browser compatibility (IE 6, 7, 8 not fully supported, though viewable, many javascript errors doing alarm handling; Firefox up to 3.6.28, which fully works by showing the extra menus, not compatible with latest versions/other brands), OC discrimination and user filters are doing OK; the application itself has a few rough ends, like somewhat terminates itself, but with the assistance of SSH checks via Nagios, a "PyMIPWAL start" can be remotely issued, etc.

 

What brings me today to the forums is a series of questions about how WAL handles external application launch, a complex yet powerful mix of Python scripts, Launch.conf referencing/tagging, and really good brains to blend all that in a trouble ticketing system to automatically fill a new ticket template with details of the selected alarm.

 

So far, it’s been easy to integrate some predefined alarm-handling scenarios where well known fields are easy to translate from dictionary to human readable statuses, such as “Outstanding, Acknowledged, ,Terminated, Archived” which came in the DummyConf.py example, also added severity information where possible values are “Warning, Minor, Major, Critical”, but it would be super cool to also pass on the “Managed Object” content, in which case dumping the complete MO reference from dictionary to the script, it wouldn't be worth the effort.

 

So far it's been possible to dump the alarm severity and Managed Object with this:

	Severity = {0:"Warning", 1:"Critical", 2:"Major", 3:"Minor"} # Translate Severity to Text
.
.
.
	return [(url+"/fill.jsp?user^B"+userName+"E"+"|seve^B"+Severity[alarms[0][4]]+"E"+"|mo^B"+alarms[0][9]+"E")] # send Fields sent to the Ticket webform
.
.
.

Now I'm stuck in interpreting fields such as Additional Text (column 7), where data flow sometimes as a string type, some other times as list type. It's OK wih string types, they go parsed OK, but list types produce an exception:  <type 'exceptions.TypeError'>: sequence item 0: expected string, list found for which I haven't found a way to:

1: Determine if the dictionary data currently looked up is a string, or list (of strings), or list (of lists)

2: Convert list objects "alarms[0][7]" to string types

3: Send the output to the form URL

 

Please let me know if there is any way I can improve and explain this post. Need more color? Want the code for the Nagios plugin that monitors different TeMIP-module (WAL, ORBIX, TNS, etc) statuses? Just chime in.

 

Thank you :-)

Collector
KeijoDPutt
Posts: 2
Registered: ‎01-02-2012
Message 2 of 2 (356 Views)

Re: [HELP] PyMIP Web Alarm List (aka. PyMIPWAL) Tips and Tricks for external URL triggering

Quick update: Aditional Text "alarms[0][7]" succesfully parsed with this formula:
StringAT = [(alarms[0][7])] # Workaround 1
AditxtSt = ''.join(StringAT) # Workaround 1

Now the script throws an 'exceptions.KeyError' when trying to handle Event Time (alarms[0][2]) and other personalized dictionary entries which appear as available in the Web Alarm List.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.