Monitor number of files

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
amitdaniel
Posts: 25
Joined: Mon Jul 01, 2013 9:17 am

Monitor number of files

Post by amitdaniel »

Hi ,

i need your help with monitoring number of files on remote server ( it's mean that i must have the " -H " function)
I found this plugin called "check_files.pl"

and when i tried to run this like that :" ./check_files.pl -F -D /etc '*.*' -w 1 -c 3 -H 10.0.51.51 "

i get this error : UNKNOWN ERROR - execution of ssh -o BatchMode=yes -o ConnectTimeout=30 10.0.51.51

but when i check on local directory i succeed to monitor.

someone can help me with that ? or maybe give me another plugin ?


Thanks !!!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitor number of files

Post by abrist »

These types of checks are usually done through an agent if they need to be run against a remote system. Does the plugin include a -H option in its help?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Monitor number of files

Post by slansing »

You can run it to a remote host if you use the SNMP version of that plugin, which would require additional setup steps. I'd also recommend running the following for the plugin's help output:

Code: Select all

./check_files.pl --help 
As Andy said you may need to install NRPE on the remote system then call it from the XI server locally to that server.
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Monitor number of files

Post by gshergill »

Hi amitdaniel,

The help output should show the following:

Code: Select all

-H, --hostaddress=<STR>
    This option followed by the IP address or the server name execute "ls"
    on the remote server with ssh. Beware the script must be run with an account
    that has its public key to the remote server.
Personally, I'd agree with abrist as well and recommend using NRPE, it's what I use for this check and it has no issues.

Code: Select all

/check_files.pl -D /var/log/openfire -F error.* -w 5 -c 10
Kind Regards,

Gary Shergill
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitor number of files

Post by abrist »

amitdaniel,
Do you have an update?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
amitdaniel
Posts: 25
Joined: Mon Jul 01, 2013 9:17 am

Re: Monitor number of files

Post by amitdaniel »

yeah

it's working when i tried to add the -H option.
another plugins working on that server (i monitor storage , cpu , memory and more)
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitor number of files

Post by lmiltchev »

Marking it as "resolved".
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked