Difference between revisions of "Plugin:FileCount"

From collectd Wiki
Jump to: navigation, search
(Use the Version template.)
(Undo revision 3727 by Carlzmodo (Talk))
 
(8 intermediate revisions by 4 users not shown)
Line 7: Line 7:
 
   | Copyright=''2008'' Alessandro Iurlano<br />''2008'' Florian octo Forster
 
   | Copyright=''2008'' Alessandro Iurlano<br />''2008'' Florian octo Forster
 
   | License={{GPLv2}}
 
   | License={{GPLv2}}
   | Manpage=[http://collectd.org/documentation/manpages/collectd.conf.5.shtml#plugin_filecount collectd.conf(5)]
+
   | Manpage={{Manpage|collectd.conf|5|plugin_filecount}}
 
}}
 
}}
 
The '''FileCount plugin''' does something very simple: Count the number of files in a directory and all its subdirectories. This can be used for a variety of statistics, for example the queue length of an MTA, the number of PHP sessions of a web server or simply the number of files in your home directory.
 
The '''FileCount plugin''' does something very simple: Count the number of files in a directory and all its subdirectories. This can be used for a variety of statistics, for example the queue length of an MTA, the number of PHP sessions of a web server or simply the number of files in your home directory.
  
In addition to the number of files, the plugin also collects the total size of all files.
+
In addition to the number of files, the plugin also collects the total size of all files. Think: ''du(1)''.
  
 
In come cases collecting all files in a directory is not desired. For instance, the session files of the [http://search.cpan.org/~markstos/CGI-Session/lib/CGI/Session.pm CGI::Session] Perl module reside in <em>/tmp</em>. But counting all files in <em>/tmp</em> doesn't tell you anything about the number of sessions. For this reason the plugin also allows you to specify which files to count. Files can be selected by:
 
In come cases collecting all files in a directory is not desired. For instance, the session files of the [http://search.cpan.org/~markstos/CGI-Session/lib/CGI/Session.pm CGI::Session] Perl module reside in <em>/tmp</em>. But counting all files in <em>/tmp</em> doesn't tell you anything about the number of sessions. For this reason the plugin also allows you to specify which files to count. Files can be selected by:
Line 45: Line 45:
  
 
[[Category:Plugins]]
 
[[Category:Plugins]]
 +
{{DEFAULTSORT:Filecount}}

Latest revision as of 08:30, 28 November 2012

FileCount plugin
Type: read
Callbacks: config, init, read
Status: supported
First version: 4.5
Copyright: 2008 Alessandro Iurlano
2008 Florian octo Forster
License: GPLv2
Manpage: collectd.conf(5)
List of Plugins

The FileCount plugin does something very simple: Count the number of files in a directory and all its subdirectories. This can be used for a variety of statistics, for example the queue length of an MTA, the number of PHP sessions of a web server or simply the number of files in your home directory.

In addition to the number of files, the plugin also collects the total size of all files. Think: du(1).

In come cases collecting all files in a directory is not desired. For instance, the session files of the CGI::Session Perl module reside in /tmp. But counting all files in /tmp doesn't tell you anything about the number of sessions. For this reason the plugin also allows you to specify which files to count. Files can be selected by:

  • Name (shell wildcards)
  • Size
  • Modification time

This plugin is a generic plugin, i.e. it cannot work without configuration, because there is no reasonable default behavior. Please read the Plugin filecount section of the collectd.conf(5) manual page for an in-depth description of the plugin's configuration.

Synopsis

<Plugin "filecount">
  <Directory "/var/qmail/queue/mess">
    Instance "qmail-message"
  </Directory>
  <Directory "/var/qmail/queue/todo">
    Instance "qmail-todo"
  </Directory>
  <Directory "/var/lib/php5">
    Instance "php5-sessions"
    Name "sess_*"
  </Directory>
</Plugin>

Example graphs

None yet. Add one now!

Dependencies

  • None