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

Performance data are wrong #312

Open
anayrat opened this issue May 17, 2022 · 1 comment
Open

Performance data are wrong #312

anayrat opened this issue May 17, 2022 · 1 comment
Labels

Comments

@anayrat
Copy link
Collaborator

anayrat commented May 17, 2022

I open this issue in order to not forget it :)

Performance data are wrong (at least with temp_files service):

check_pgactivity --status-file /var/lib/postgresql/check_pgactivity.data -F human -s temp_files   -w '10,500m' -c '50,5G'
Service        : POSTGRES_TEMP_FILES
Returns        : 0 (OK)
Message        : 4 tablespace(s)/database(s) checked
Perfdata       : postgres=0Fpm
Perfdata       : postgres=0Bpm
Perfdata       : postgres=0Files warn=500 crit=5
Perfdata       : postgres=0B

Expect to have warn=10 crit=50 on # files and warn=500m crit=5G on file size.

Regards,

@anayrat anayrat added the bug label May 17, 2022
@anayrat
Copy link
Collaborator Author

anayrat commented Sep 14, 2022

I completely forgot this issue.
The problem is the "b" is missing in the unit:

-'10,500m'
+'10,500mb'

We should fix the documentation:

If THRESHOLD is a size, the following units are accepted (not case sensitive): b (Byte), k (KB), m (MB), g (GB), t (TB), p (PB), e (EB) or Z (ZB). Only integers are accepted. Eg. 1.5MB will be refused, use 1500kB.

To:

If THRESHOLD is a size, the following units are accepted (not case sensitive): b (Byte), kb (KB), mb (MB), gb (GB), tb (TB), pb (PB), eb (EB) or zb (ZB). Only integers are accepted. Eg. 1.5MB will be refused, use 1500kB.

I try to add a test in order to trigger an error if the format is not respected (\d+)(,\d+[kmgtpez]?b)?. But I wasn't able to add such test without breaking the while :(

while ( $args{'warning'} =~ m/(?:(\d+)([kmgtpez]?b)?)/ig ) {

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

No branches or pull requests

1 participant