Bug #58594 Add Exception checking to example blackout script
Submitted: 30 Nov 2010 15:51 Modified: 5 Jan 2011 18:32
Reporter: Mark Leith Email Updates:
Status: Closed Impact on me:
Category:MySQL Enterprise Monitor: Documentation Severity:S3 (Non-critical)
Version:2.2+ OS:Any
Assigned to: John Russell CPU Architecture:Any

[30 Nov 2010 15:51] Mark Leith
The script example in the documentation does not check for known exceptions, so it can be run, and actually appear to succeed, when really some internal exception is being returned that is just ignored. 


How to repeat:
perl ./blackout.pl localhost:8080 admin mysql nonexistantservername:3306 true

Suggested fix:
Add the following to the bottom of the script:

  if ($response->content =~ /UserUnauthorizedException/ ||
       $response->content =~ /ServerDoesNotExistException/) { 
  	die $response->content;
[5 Jan 2011 18:32] John Russell
Added to 2.3 and 2.2 manuals.