59 Commits

Author SHA1 Message Date
Johannes Meyer
777d146ba1 Perfdata: Avoid passing null to number_format() 2022-05-27 14:41:42 +02:00
Johannes Meyer
3dc384fb58 Avoid passing null to non-nullable arguments 2022-03-24 12:29:06 +01:00
Johannes Meyer
c038e84fc2 Ensure Return Type Compatibility with Internal Classes 2022-03-24 12:29:06 +01:00
Johannes Meyer
e7bc0a136b Perfdata: Render unknown UOMs as-is 2022-02-28 11:53:59 +01:00
Johannes Meyer
a4d495e17c PerfData: Don't render missing values as 0.00 2021-04-13 14:50:18 +02:00
Johannes Meyer
8c73f0462e InlinePie: Utilize SVG to render charts instantly
Inline pie charts usually don't contain that much
data and the SVG should be rather small in size.
So it doesn't hurt rendering them instantly.
2020-09-28 16:40:39 +02:00
Feu Mourek
57f966734a Perfdata: add function to get perfdata unit 2019-11-04 11:36:57 +01:00
Janne Heß
d45c753409 Support temperatures (°C, °F) in perfdata 2019-04-05 15:28:51 +02:00
Alexander A. Klimov
259bafea35 Perfdata::format(): handle ThresholdRanges
refs #8194
2018-05-03 15:12:42 +02:00
Alexander A. Klimov
392231dc81 Perfdata: return ThresholdRange from getWarningThreshold() and getCriticalThreshold()
refs #8194
2018-05-03 15:11:52 +02:00
Alexander A. Klimov
bc5d3b64c4 ThresholdRange::fromString(): compare non-strictly
refs #8194
2018-05-03 15:11:52 +02:00
Alexander A. Klimov
81601e6303 ThresholdRange::fromString(): drop default
refs #8194
2018-05-03 15:11:52 +02:00
Alexander A. Klimov
b706792c9b Preserve threshold ranges in ThresholdRange, not in Perfdata
refs #8194
2018-05-03 15:11:52 +02:00
Alexander A. Klimov
881267d829 ThresholdRange::fromString(): default to -∞:∞
refs #8194
2018-05-03 15:11:52 +02:00
Alexander A. Klimov
54002cb3e5 Perfdata: print warn and crit human-readable if the start is -∞
refs #8194
2018-05-03 15:11:52 +02:00
Alexander A. Klimov
2270e250d3 Perfdata: use ThresholdRange
refs #8194
2018-05-03 15:10:31 +02:00
Alexander A. Klimov
cdb1db89e2 ThresholdRange: trim(floatval()) -> floatval(trim())
refs #8194
2018-05-03 15:00:48 +02:00
Alexander A. Klimov
7865db9053 Perfdata: simplify code design
refs #8194
2018-05-03 15:00:48 +02:00
Alexander A. Klimov
e006902254 ThresholdRange::setInverted(): default to true
refs #8194
2018-05-03 15:00:48 +02:00
Alexander A. Klimov
7273959007 ThresholdRange: reword doc
refs #8194
2018-05-03 15:00:48 +02:00
Alexander A. Klimov
746eb07862 ThresholdRange: use substr() instead of strpos() where more performant
refs #8194
2018-05-03 15:00:48 +02:00
Alexander A. Klimov
ddde4b447c ThresholdRange: trim() raw ranges
refs #8194
2018-05-03 15:00:48 +02:00
Alexander A. Klimov
5df6eeaeaf Implement ThresholdRange
refs #8194
2018-05-03 15:00:48 +02:00
Eric Lippmann
73a6750489 Make phpcs and PhpStorm happy w/ intentional switch, case fall-throughs
Unfortunately, PhpStorm does not regonise PSR2 fall-through comments.
On the other hand, phpcs does not support the @noinspection phpdoc comment (/**).
The fix is a mix of PSR2 comments and @noinspection tags in code comments.
2017-11-08 10:25:28 +01:00
Johannes Meyer
181e2ef05c Swag: Fix swag (aka a whole bunch of code style issues..) 2017-01-27 14:48:59 +01:00
Alexander A. Klimov
13085776d8 Performance data: handle negative values
fixes #11915
2016-08-31 15:46:22 +02:00
Alexander A. Klimov
474803fee4 Change all license headers to only reflect a file's year of creation
refs #11000
2016-02-08 15:41:00 +01:00
Alexander A. Klimov
aad7baa5c4 Perfdata::getPercentage(): prevent division by integer 0
fixes #10331
2015-12-15 17:32:45 +01:00
Eric Lippmann
a12cc9ab30 monitoring/CSS: Don't set class sparkline-perfdata
Class not in use.

refs #5543
2015-11-12 09:45:35 +01:00
Matthias Jentsch
3caa5b428a Merge branch 'bugfix/don-t-show-more-than-the-five-worst-pies-in-list-views-8205'
fixes #8205
2015-06-16 18:40:03 +02:00
Matthias Jentsch
a5c3782de7 Do not display columns that don't include any values
refs #8334
2015-06-02 15:20:27 +02:00
Alexander A. Klimov
6e24cfd538 Implement ::worseThan()
refs #8205
2015-05-29 18:29:45 +02:00
Alexander A. Klimov
1f36e545d9 Implement ::getState()
refs #8205
2015-05-29 17:26:56 +02:00
Alexander A. Klimov
9e3d65e4e9 Display performance data metrics with value 0
fixes #8744
2015-05-12 17:44:53 +02:00
Eric Lippmann
ab1dc1faa0 Do not translate format strings 2015-03-30 11:28:05 +02:00
Eric Lippmann
0a7e76d190 Fix typo in Perfdata::formatLabel()'s PHPDoc 2015-03-30 11:27:17 +02:00
Eric Lippmann
6bae2e0a53 Note that our license is GPL v2 or any later version in our license header instead of pointing to the license's URL 2015-02-04 10:52:27 +01:00
Eric Lippmann
5b4fab0750 Add license header
This time without syntax errors hopefully :)
2015-02-03 16:27:59 +01:00
Eric Lippmann
5fa2e3cfdc Revert "Add license header"
This reverts commit 338d067aba41dd6e9178cebec5433eecd614196e.
2015-02-03 16:16:26 +01:00
Eric Lippmann
338d067aba Add license header
fixes #7788
2015-02-03 15:51:04 +01:00
Matthias Jentsch
5e2594d250 Parse perfdata thresholds provisionary
Use a heuristic to determine whether thresholds should be inverted, to support plugins with non-standard perfdata output while still being able to parse standard-compliant perfdata input.
2015-01-13 10:59:33 +01:00
Matthias Jentsch
b5747797b7 Fix perfdata output
Display all perfdata key-value pairs in a formatted table, add padding to table css
improve piechart label.
2014-12-30 16:35:42 +01:00
Matthias Jentsch
41c101d99f Use neutral default color in perfdata piecharts
If nothing is known about the state of the monitoring object, the piecharts should neither indicate OK nor Critical.
2014-12-23 16:12:25 +01:00
Matthias Jentsch
c93b13b138 Rework behavior of perfdata visualization
Determine perfdata pie color from host or service state, display zero percent piecharts, only render displayabl PieCharts with min and max values, move perfdata to piechart conversion functions into the Perfdata object.

fixes #6423
fixes #6200
fixes #7170
fixes #7304
2014-12-23 15:54:27 +01:00
Thomas Gelf
51484ebf88 monitoring/Perfdata: ignore invalid min/max
key=23;0;0;0;0 and key=23;;;; lead to division by zero exceptions
This should fix this by ignoring empty strings for min/max (formerly
it got "converted" to float(0)) and also ignores min == max.

fixes #6828
2014-07-31 16:52:34 +02:00
Johannes Meyer
bacea36ad9 Improve piechart limitation and show non-piechart perfdata as well
The perfdata helper did an improper limitation as it might have skipped
valid values due to applying the limit before the filter. When not in compact
view the helper now also shows non-piechart values by using their raw
representation.

refs #6515
2014-07-14 13:48:30 +02:00
Johannes Meyer
ec2d1daa6b Perfdata plugin should also have a knowledge about labels
Prior to this change the PerfdataSet only knew the labels of a performance
data value which prevented the Perfdata object from being used
individually.

refs #6515
2014-07-11 16:31:00 +02:00
Matthias Jentsch
85aed364b7 Fix typing error in 'threshold' 2014-06-25 15:02:04 +02:00
Matthias Jentsch
35a5431512 Revert "Refractor InlinePie and Perfdata helper"
This reverts commit f003c38abd969ac0a728749563727454cfc744f5.
2014-06-25 14:29:17 +02:00
Matthias Jentsch
f003c38abd Refractor InlinePie and Perfdata helper
Refractor InlinePie methods for better usability, fix several coding guideline
issues and fix some typos
2014-06-25 12:41:17 +02:00