Home Directory Plugins Operating Systems Linux Check number of files in directory via telnet

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Check number of files in directory via telnet

Rating
0 votes
Favoured:
0
Current Version
1
Last Release Date
2009-09-08
Compatible With
  • Nagios 2.x
  • Nagios 3.x
Hits
100169
Files:
FileDescription
check_num_files_telnet.expcheck_num_files_telnet.exp
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Plugin to check number of files in a remote directory using telnet. Implemented in Expect.
Not just for Linux but should work for most UNIXs. It was cobbled together to check the number of incoming files on an old SCO server.

I hope that this script can also be used as an example of how expect can be used to automate collection of metrics through interactive applications such as telnet. One of the strengths of using expect (or a implementation of expect in another language such as perl or ruby) is the level of error checking that is possible. As this script was needed for a quick fix I did not have the time to implement full error checking.

Performance data is returned.

You may need to edit the shell prompt variable within the script. I kept this variable internal and not as a commandline option as # and > are potentially awkward to quote.

You will be gratified to hear that I ran 'shutdown -y' for the last time on the SCO server today. This does mean that I am unlikely to update this script.