Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Minimum and Maximum variables to the Agent CPU Load check #1683

Open
kbilev opened this issue May 22, 2024 · 1 comment
Open

Add Minimum and Maximum variables to the Agent CPU Load check #1683

kbilev opened this issue May 22, 2024 · 1 comment

Comments

@kbilev
Copy link
Contributor

kbilev commented May 22, 2024

Is your feature request related to a problem? Please describe.
Performance Data only provides the warning, critical and min=0 values, no maximum value.
When using for example Tachographs in a Dashboard with CPU Load provided by the agent, the minimum is set to 0 and the maximum to 100.

Describe the solution you'd like
Add arguments for Minimum and Maximum to the CPU load check (and if they are empty, continue to use the default values)

Describe alternatives you've considered
As workaround I have added in the SystemLoad.php a $critical + 10 as maximum value which is already better than the default empty value or 100 in the Tachograph as it is empty.

Additional context
Before:
image
After:
image

@kbilev
Copy link
Contributor Author

kbilev commented Sep 23, 2024

The workaround

$this->addPerfdata(new PerfdataGauge(
            'load1',
            round($this->json['system_load'][0], 2),
            '',
            $warning,
            $critical,
            0,
            $critical + 10
        ));

        $this->addPerfdata(new PerfdataGauge(
            'load5',
            round($this->json['system_load'][1], 2),
            '',
            $warning,
            $critical,
            0,
            $critical + 10
        ));

        $this->addPerfdata(new PerfdataGauge(
            'load15',
            round($this->json['system_load'][2], 2),
            '',
            $warning,
            $critical,
            0,
            $critical + 10
        ));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant