Changeset d1526ca817ef305f15a4f6418c2699bee9663f51
- Timestamp:
- 04/23/10 20:07:11
(3 years ago)
- Author:
- Mark Harrison <mark@omniti.com>
- git-committer:
- Mark Harrison <mark@omniti.com> 1272053231 +0000
- git-parent:
[117de5423d008dc004459bff76cfcd44a3ab4068]
- git-author:
- Mark Harrison <mark@omniti.com> 1272053231 +0000
- Message:
Change modules to use die instead of manually returning an error metric
git-svn-id: https://labs.omniti.com/resmon/branches/resmon2@314 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rd29cd18 |
rd1526ca |
|
| 100 | 100 | } else { |
|---|
| 101 | 101 | # We couldn't get the free space |
|---|
| 102 | | return { |
|---|
| 103 | | "error" => ["Unable to get free space", "s"] |
|---|
| 104 | | } |
|---|
| | 102 | die "Unable to get free space\n"; |
|---|
| 105 | 103 | } |
|---|
| 106 | 104 | }; |
|---|
| rfd93a8d |
rd1526ca |
|
| 118 | 118 | } else { |
|---|
| 119 | 119 | # We couldn't match the output line |
|---|
| 120 | | return { |
|---|
| 121 | | "error" => ["Unable to get free inode count", "s"] |
|---|
| 122 | | } |
|---|
| | 120 | die "Unable to get free inode count\n"; |
|---|
| 123 | 121 | } |
|---|
| 124 | 122 | }; |
|---|
| r4cff28c |
rd1526ca |
|
| 75 | 75 | |
|---|
| 76 | 76 | my $count = run_command("$pgrep_path", "-c$full", "$config->{pattern}"); |
|---|
| 77 | | if (!defined($count)) { |
|---|
| 78 | | return { |
|---|
| 79 | | "error" => ["Unable to run pgrep command", "s"] |
|---|
| 80 | | } |
|---|
| 81 | | } |
|---|
| | 77 | die "Unable to run pgrep command\n" if (!defined($count)); |
|---|
| 82 | 78 | chomp $count; |
|---|
| 83 | 79 | |
|---|
| … | … | |
| 89 | 85 | # We didn't get a count as expected. This can happen if you didn't |
|---|
| 90 | 86 | # provide a pattern or something else went wrong. |
|---|
| 91 | | return { |
|---|
| 92 | | "error" => ["Pgrep gave unexpected output: $count", "s"] |
|---|
| 93 | | }; |
|---|
| | 87 | die "Pgrep gave unexpected output: $count\n"; |
|---|
| 94 | 88 | }; |
|---|
| 95 | 89 | }; |
|---|