Changeset e20fdcd154dd66e4df5502753a726f0a82e7714d
- Timestamp:
- 12/17/09 22:46:23
(3 years ago)
- Author:
- Jason Dixon <jdixon@omniti.com>
- git-committer:
- Jason Dixon <jdixon@omniti.com> 1261089983 +0000
- git-parent:
[54eb3feb6589e8a4124695b188f2b94552b0de6a]
- git-author:
- Jason Dixon <jdixon@omniti.com> 1261089983 +0000
- Message:
fixes #223
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r72e62f7 |
re20fdcd |
|
| 152 | 152 | obj = (doc:xpath("state", result))() |
|---|
| 153 | 153 | check.metric_string(prefix .. "state", obj and obj:contents()) |
|---|
| 154 | | obj = (doc:xpath("message", result))() |
|---|
| 155 | | check.metric_string(prefix .. "message", obj and obj:contents()) |
|---|
| | 154 | local metrics = 0 |
|---|
| | 155 | for metric in doc:xpath("metric", result) do |
|---|
| | 156 | metrics = metrics + 1 |
|---|
| | 157 | local name = metric:attr("name") or "DUMMY" |
|---|
| | 158 | local type = metric:attr("type") or "DUMMY" |
|---|
| | 159 | if type == 'i' then |
|---|
| | 160 | check.metric_int32(prefix .. name, metric and metric:contents()) |
|---|
| | 161 | elseif type == 'I' then |
|---|
| | 162 | check.metric_uint32(prefix .. name, metric and metric:contents()) |
|---|
| | 163 | elseif type == 'l' then |
|---|
| | 164 | check.metric_int64(prefix .. name, metric and metric:contents()) |
|---|
| | 165 | elseif type == 'L' then |
|---|
| | 166 | check.metric_uint64(prefix .. name, metric and metric:contents()) |
|---|
| | 167 | elseif type == 'n' then |
|---|
| | 168 | check.metric_double(prefix .. name, metric and metric:contents()) |
|---|
| | 169 | elseif type == 's' then |
|---|
| | 170 | check.metric_string(prefix .. name, metric and metric:contents()) |
|---|
| | 171 | else |
|---|
| | 172 | check.metric(prefix .. name, metric and metric:contents()) |
|---|
| | 173 | end |
|---|
| | 174 | end |
|---|
| | 175 | if metrics == 0 then |
|---|
| | 176 | local message = (doc:xpath("message", result))() |
|---|
| | 177 | check.metric_string(prefix .. "message", message and message:contents()) |
|---|
| | 178 | end |
|---|
| 156 | 179 | end |
|---|
| 157 | 180 | check.metric_uint32("services", services) |
|---|