alert on file size if greater than 0 bytes wmi

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
vnc786
Posts: 68
Joined: Thu Aug 29, 2013 8:45 am

alert on file size if greater than 0 bytes wmi

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

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

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
donlewis
Posts: 3
Joined: Thu Sep 03, 2015 5:06 am

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

Post 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
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

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

Post 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?
Former Nagios Employee.
me.
donlewis
Posts: 3
Joined: Thu Sep 03, 2015 5:06 am

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

Post 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
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

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

Post 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!
Former Nagios Employee.
me.
Locked