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

The memfree item with threshold #8

Open
yy963 opened this issue Dec 16, 2021 · 0 comments
Open

The memfree item with threshold #8

yy963 opened this issue Dec 16, 2021 · 0 comments

Comments

@yy963
Copy link

yy963 commented Dec 16, 2021

The swapfree and memfree codes is diffrent,but their the logic of the judgement is the same,and the result should be same
I modify follows:

if ($plugin->opts->item eq 'memfree') {

# -- add 100 - make the free become avaliable
$data_val = 100 - getPercentage('memtotal',$data_val);

}

if($plugin->opts->item eq 'memfree') {
$plugin->set_thresholds(warning => (100 - $plugin->opts->warning), critical => (100 - $plugin->opts->critical));

   # -- add 2 lines make the display value and actual match  
    $output_val = 100-$data_val;
    $output_text = $plugin->opts->item . " = " . $output_val;

} else {
$plugin->set_thresholds(warning => $plugin->opts->warning, critical => $plugin->opts->critical);
}

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