Changeset 880c6cef6cac121bb61370f67d47c78025b3b0ef
- Timestamp:
- 04/25/11 21:37:36
(2 years ago)
- Author:
- Mark Harrison <mark@mivok.net>
- git-committer:
- Mark Harrison <mark@mivok.net> 1303767456 -0400
- git-parent:
[e5c7025c2dfd4fd6f3a70759b51e8ab7a1efd1b2]
- git-author:
- Mark Harrison <mark@mivok.net> 1303767456 -0400
- Message:
Improved output on errors/regex/equals checks
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| re5c7025 |
r880c6ce |
|
| 320 | 320 | # Make the HTTP request |
|---|
| 321 | 321 | my $res = $ua->request($t); |
|---|
| 322 | | die "CRITICAL: could not fetch\n" unless($res && $res->is_success); |
|---|
| | 322 | die "could not fetch http://$host:$port$url - " . $res->status_line ."\n" |
|---|
| | 323 | unless($res && $res->is_success); |
|---|
| 323 | 324 | # Parse the xml |
|---|
| 324 | 325 | eval { $ref = $xs->XMLin($res->content, ForceArray => 1); }; |
|---|
| 325 | | die "CRITICAL: error parsing XML\n" if($@); |
|---|
| | 326 | die "error parsing XML\n" if($@); |
|---|
| 326 | 327 | |
|---|
| 327 | 328 | # Debugging |
|---|
| … | … | |
| 370 | 371 | $state = "CRITICAL"; |
|---|
| 371 | 372 | } |
|---|
| 372 | | print "$state: $value\n"; |
|---|
| | 373 | print "$state: $metric = $value\n"; |
|---|
| 373 | 374 | } |
|---|
| 374 | 375 | |
|---|
| … | … | |
| 379 | 380 | $state = "CRITICAL"; |
|---|
| 380 | 381 | } |
|---|
| 381 | | print "$state: $value\n"; |
|---|
| | 382 | print "$state: $metric - $value\n"; |
|---|
| 382 | 383 | } |
|---|
| 383 | 384 | |
|---|