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


Remember Me

Directory Tree

Check number of files in directory via telnet

0 votes
Current Version
Last Release Date
Compatible With
  • Nagios 2.x
  • Nagios 3.x
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
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.