Page 1 of 1

alert on file size if greater than 0 bytes wmi

Posted: Mon Aug 31, 2015 9:38 am
by vnc786
Hi Team,

need to get warning or critical alert if the specified file size is greater than 0bytes.

Code: Select all

./check_wmi_plus.pl -H 192.168.106.83 -u user -p '***' -m checkfilesize -a E:/error.log -w 1,0bytes -c 150g
OK - File E:/error.log is 0.000B. Found 1 instance(s).|'E:/error.log Size'=0bytes;1;161061273600; 'File Count'=1;
i tried some combination but didnt got success. any help appreciated.

Re: alert on file size if greater than 0 bytes wmi

Posted: Mon Aug 31, 2015 12:56 pm
by lmiltchev
Can't you just run the command below?

Code: Select all

./check_wmi_plus.pl -H 192.168.106.83 -u user -p '***' -m checkfilesize -a E:/error.log -w 0 -c 150g
You should get a warning if the "error.log" is greater than 0 bytes (it currently 0 bytes, so it shows ok)
OK - File E:/error.log is 0.000B

Re: alert on file size if greater than 0 bytes wmi

Posted: Thu Sep 03, 2015 5:23 am
by donlewis
Hi!

I have similar problem.
I'd like to check some files and I'm always giving back the same result: Size'=0bytes regardless of the files.
In other cases the WMI_plus checkings work fine, but the "checkfilesize" command has any problem....
Windows auth. OK, WMI service OK on the specific MS-W client: I can get all information of the requested files from WMI service directly.

My WMI_Plus VERSION="1.49"

Any help appreciated. Please help me!!! :cry:

Thnx in advance,
Don Lewis

Re: alert on file size if greater than 0 bytes wmi

Posted: Thu Sep 03, 2015 9:15 am
by hsmith
donlewis wrote:Hi!

I have similar problem.
I'd like to check some files and I'm always giving back the same result: Size'=0bytes regardless of the files.
In other cases the WMI_plus checkings work fine, but the "checkfilesize" command has any problem....
Windows auth. OK, WMI service OK on the specific MS-W client: I can get all information of the requested files from WMI service directly.

My WMI_Plus VERSION="1.49"

Any help appreciated. Please help me!!! :cry:

Thnx in advance,
Don Lewis
Can you post the command you are using to get these results, along with the command line output of it?

Re: alert on file size if greater than 0 bytes wmi

Posted: Fri Sep 04, 2015 7:19 am
by donlewis
hsmith wrote:
donlewis wrote:Hi!

I have similar problem.
I'd like to check some files and I'm always giving back the same result: Size'=0bytes regardless of the files.
In other cases the WMI_plus checkings work fine, but the "checkfilesize" command has any problem....
Windows auth. OK, WMI service OK on the specific MS-W client: I can get all information of the requested files from WMI service directly.

My WMI_Plus VERSION="1.49"

Any help appreciated. Please help me!!! :cry:

Thnx in advance,
Don Lewis
Can you post the command you are using to get these results, along with the command line output of it?
Hi!
Thnx for your help!
I've managed to find solution for the problem above: I have to upgrade my wmi_plus cause of plugin-error as the developers state in "http://edcint.co.nz/checkwmiplus/?q=Change%20Log" website.

But I have an another "interesting" problem:
I want to run the following nrpe command:
/check_nrpe -n -H 10.132.12.71 -c checkfiles -a path="d:\\temp\\Backup\\1\\" pattern=*.tar filter="written > -8d" syntax="Backup files exist :%(name) size:%(size) bytes" MinWarn=0 MinCrit=0
The requested file doesn't exist, so the command above should run to "CRITICAL" state and gives back the following detailed results:
D disk Created command: warn=count<=0 crit=count<=0 "filter=written > -8d"
pattern=*.tar "detail-syntax=Backup files exist :%(name)
size:%(size) bytes" top-syntax=${list} path=d:\temp\Backup\1\ empty-state=ok
L cli OK: No files found
L cli Performance data: 'count'=0;0;0
WHY??? Why "cli OK" and not "cli CRITICAL"?
In my opinion that's very embarassing and irritating.
Can you help me? Or I've to put this question to another topic?.... :?

Thnx in advance,
Don Lewis

Re: alert on file size if greater than 0 bytes wmi

Posted: Fri Sep 04, 2015 9:22 am
by hsmith
donlewis wrote:
hsmith wrote:
donlewis wrote:Hi!

I have similar problem.
I'd like to check some files and I'm always giving back the same result: Size'=0bytes regardless of the files.
In other cases the WMI_plus checkings work fine, but the "checkfilesize" command has any problem....
Windows auth. OK, WMI service OK on the specific MS-W client: I can get all information of the requested files from WMI service directly.

My WMI_Plus VERSION="1.49"

Any help appreciated. Please help me!!! :cry:

Thnx in advance,
Don Lewis
Can you post the command you are using to get these results, along with the command line output of it?
Hi!
Thnx for your help!
I've managed to find solution for the problem above: I have to upgrade my wmi_plus cause of plugin-error as the developers state in "http://edcint.co.nz/checkwmiplus/?q=Change%20Log" website.

But I have an another "interesting" problem:
I want to run the following nrpe command:
/check_nrpe -n -H 10.132.12.71 -c checkfiles -a path="d:\\temp\\Backup\\1\\" pattern=*.tar filter="written > -8d" syntax="Backup files exist :%(name) size:%(size) bytes" MinWarn=0 MinCrit=0
The requested file doesn't exist, so the command above should run to "CRITICAL" state and gives back the following detailed results:
D disk Created command: warn=count<=0 crit=count<=0 "filter=written > -8d"
pattern=*.tar "detail-syntax=Backup files exist :%(name)
size:%(size) bytes" top-syntax=${list} path=d:\temp\Backup\1\ empty-state=ok
L cli OK: No files found
L cli Performance data: 'count'=0;0;0
WHY??? Why "cli OK" and not "cli CRITICAL"?
In my opinion that's very embarassing and irritating.
Can you help me? Or I've to put this question to another topic?.... :?

Thnx in advance,
Don Lewis
Please post another topic. We try to keep the posts to one question per, as it's much easier to all be on the same page as a support team that way. :geek:

Going to lock this one, but please repost your question!