#156 closed defect (fixed)
Empty Label while reporting performance data with "checkfile"
| Reported by: | anonymous | Owned by: | mickem |
|---|---|---|---|
| Priority: | 1 | Milestone: | 0.3.3 |
| Component: | Core | Version: | 0.3.1 |
| Severity: | Bugs | Keywords: | preformance data empty checkfile |
| Cc: |
Description
Hi,
I´ve got problems getting the performance data into pnp. I figured out that the label is empty, therefore pnp cant display it.
Here´s what I did:
nsclient++ -test
checkfile file=c:\boot.ini filter=all truncate=512 MinWarn=0 MinCrit=0 syntax=%filename%,%creation% filter-creation=<3h
NSClient++.cpp(516) Injecting: checkfile: file=c:\boot.ini, filter=all, truncate=512, MinWarn=0, MinCrit=0, syntax=%filename%,%creation%, filter-creation=<3h
NSClient++.cpp(536) Injected Result: CRITICAL ': 0 < critical'
NSClient++.cpp(537) Injected Performance Result: =0;0;0; '
CRITICAL:: 0 < critical|=0;0;0;
Is there a way to get the filled?
Thank you in advance,
fsom
Change History (8)
comment:1 Changed 5 years ago by mickem
- Owner changed from MickeM to mickem
- Status changed from new to assigned
comment:2 Changed 5 years ago by mickem
- Milestone changed from 0.4.0 to 0.3.3
- Resolution set to fixed
- Status changed from assigned to closed
Will be fixed in the next nightly.
comment:3 Changed 5 years ago by AndersB
- Resolution fixed deleted
- Status changed from closed to reopened
Are you sure this is solved? I downloaded version 0.3.3 today and tried the following in "nsclient++ -test"-mode:
checkfile file=C:\boot.ini filter-written=>1000d syntax=gurka MaxCrit=1 d \NSClient++.cpp(541) Injecting: checkfile: file=C:\boot.ini, filter-written=>1 000d, syntax=gurka, MaxCrit=1 d \NSClient++.cpp(561) Injected Result: OK 'CheckFile ok' d \NSClient++.cpp(562) Injected Performance Result: '''=0;0;1; ' OK:CheckFile ok|''=0;0;1;
...no label in performance data when status is ok.
But when status is critical:
checkfile file=C:\boot.ini filter-written=>1d syntax=gurka MaxCrit=1 d \NSClient++.cpp(541) Injecting: checkfile: file=C:\boot.ini, filter-written=>1 d, syntax=gurka, MaxCrit=1 d \NSClient++.cpp(561) Injected Result: CRITICAL 'gurka, boot.ini: 1 > critical' d \NSClient++.cpp(562) Injected Performance Result: ''boot.ini'=1;0;1; ' CRITICAL:gurka, boot.ini: 1 > critical|'boot.ini'=1;0;1;
...I get a label.
Also, I tried to understand the "define your own alias"-concept but I guess I'm not smart enough. Consider the following example
checkfile file=c:\temp\test filter-written=>10s syntax=gurka MaxCrit=1 d \NSClient++.cpp(541) Injecting: checkfile: file=c:\temp\test, filter-written=> 10s, syntax=gurka, MaxCrit=1 d \NSClient++.cpp(561) Injected Result: CRITICAL 'gurka, gurka, potatis, sparris : 2 > critical' d \NSClient++.cpp(562) Injected Performance Result: ''potatis, sparris'=2;0;1; ' CRITICAL:gurka, gurka, potatis, sparris: 2 > critical|'potatis, sparris'=2;0;1;
The label will be the name of the files in the folder, which will change from time to time. PNP require the label to be constant so I tried this:
checkfile file:Saker=c:\temp\test filter-written=>10s syntax=gurka MaxCrit=1 d \NSClient++.cpp(541) Injecting: checkfile: file:Saker=c:\temp\test, filter-wri tten=>10s, syntax=gurka, MaxCrit=1 d \NSClient++.cpp(561) Injected Result: WARNING 'Unknown argument: file:Saker' d \NSClient++.cpp(562) Injected Performance Result: '' WARNING:Unknown argument: file:Saker
Any ideas?
comment:4 Changed 5 years ago by mickem
- Resolution set to fixed
- Status changed from reopened to closed
ahh...
my "fix" used the first filename (or more if less then 16 chars) of the found files. In your example there is no files that match thus there was no name. Next version will have a "if label still empty" use "not found".
Just curious: are you Swedish by any chance?
MickeM
comment:5 Changed 5 years ago by mickem
also added new option:
+ Added new option alias to controll the name for performance counters when using checkfile use like so:
checkfile alias=foo file=C:\boot.ini filter-written=>1000d syntax=gurka MaxCrit=1
(nightly out in secs, let me know if it works...)
comment:6 Changed 5 years ago by AndersB
The alias option did the trick! Thanks.
Also, 'not found' was displayed when I was not using alias so that works too. However, I'm not sure how useful that is. Maybe the performance counter just should be named "matches", or is there any case where the value will show something else than how many files that matched?
Helt rätt, jag är svensk.
/Anders
comment:7 Changed 5 years ago by mickem
in your case (boot.ini it will show boot.ini if there is a "problem" with that file.
For instance:
Is there files larger then 5Mbs on c:?
(and I am just thinking out loud so might be all wrong here)
file=c:\ filter=all truncate=512 MaxWarn=0 MaxCrit=0 filter-size=>5M
would yield the name(s) of the large files as the alias... but indeed maybe a
"matches" is better as it makes more sense?
And I guessed as much from all them vegetables :)
Michael Medin
comment:8 Changed 5 years ago by AndersB
I think the actual names of the files that matched makes more sense to have in the regular output.
/Anders









It is a bug, alias should not be empty in this case.
A "workaround" is to define you own alias using the : syntax like so:
MickeM