diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-03-02 13:49:06 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-03-02 13:49:06 +0000 |
commit | 4dcd4d96b7b1a2a0880a374f142c160df259c648 (patch) | |
tree | 90b61604231023a2c3d951f3e54ce6bb47378714 /lib | |
parent | f75c3e02447ceb9a201c1107ecb0d7844b8000d2 (diff) | |
download | mangemanche-4dcd4d96b7b1a2a0880a374f142c160df259c648.tar.gz mangemanche-4dcd4d96b7b1a2a0880a374f142c160df259c648.tar.bz2 |
Document particular commands.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/App/Ping903/Command/dbload.pm | 148 | ||||
-rw-r--r-- | lib/App/Ping903/Command/ident.pm | 20 | ||||
-rw-r--r-- | lib/App/Ping903/Command/inspect.pm | 20 | ||||
-rw-r--r-- | lib/App/Ping903/Command/ipadd.pm | 41 | ||||
-rw-r--r-- | lib/App/Ping903/Command/ipdel.pm | 39 |
5 files changed, 268 insertions, 0 deletions
diff --git a/lib/App/Ping903/Command/dbload.pm b/lib/App/Ping903/Command/dbload.pm index d7b4e20..20c8ad1 100644 --- a/lib/App/Ping903/Command/dbload.pm +++ b/lib/App/Ping903/Command/dbload.pm @@ -90,6 +90,154 @@ sub run { 1; +=head1 NAME + +dbload - Load IP addresses from database into Ping903 + +=head1 SYNOPSIS + +B<dbload> +[B<-D> I<DRIVER>] +[B<-P> I<DBPORT>] +[B<-c> I<COLUMN>] +[B<-d> I<DBNAME>] +[B<-h> I<DBHOST>] +[B<-p> I<DBPASS>] +[B<-q> I<QUERY>] +[B<-t> I<TABLE>] +[B<-u> I<DBUSER>] +[B<--column>=I<COLUMN>] +[B<--database>=I<DBNAME>] +[B<--defaults-file>=I<FILE>] +[B<--driver>=I<DRIVER>] +[B<--host>=I<DBHOST>] +[B<--params>=I<DBPARAM>] +[B<--password>=I<DBPASS>] +[B<--port>=I<DBPORT>] +[B<--query>=I<QUERY>] +[B<--table>=I<TABLE>] +[B<--user>=I<DBUSER>] + +=head1 DESCRIPTION + +Reads IP addresses from the database and adds them to the list of monitored +hosts of L<ping903>. + +Most parameters are configurable. You need to supply at least the database +connection information and the query to use. For the latter, use the +B<--table> and B<--column> options together. For really complex queries, +use the B<--query> option instead. See below for details. + +On success, prints on standard output the number of IP addresses loaded and +exits with status 0. On error, displays on stabdard error the detailed +diagnostic information as obtained from the server and exits with status 1. + +=head1 OPTIONS + +=head2 Database connection options + +=over 4 + +=item B<-D>, B<--driver>=I<DRIVER> + +Sets L<DBI> database driver name. Default is C<mysql>. + +=item B<-h>, B<--host>=I<NAME> + +Name or IP address of the database server. + +=item B<-P>, B<--port>=I<PORT> + +Port number the database server listens on. + +=item B<-d>, B<--database>=I<NAME> + +Name of the database to use. + +=item B<-u>, B<--user>=I<USER> + +Database user name. + +=item B<-p>, B<--password>=I<PASS> + +Database password. + +=item B<--defaults-file>=I<FILE> + +Name of the MySQL defaults file to use. This option is used only if DBI +driver B<mysql> is used. By default, the file F<.my.cnf> in the home +directory is used, if it exists. + +=item B<--params>=I<STRING> + +Additional parameters for the DBI driver. For detailed information, refer +to the documentation of the driver in use. + +=back + +=head2 Query to extract IP addresses from the database + +Three options are provided: + +=over 4 + +=item B<-t>, B<--table>=I<TABLE> + +Name of the table which holds IP addresses. + +=item B<-c>, B<--column>=I<NAME> + +Name of the column in I<TABLE> where IP address is stored. If need +be, you can use SQL expression as well. + +=item B<-q>, B<--query>=I<STRING> + +SQL query to use in order to obtain IP addresses. This overrides the two +options above. + +=back + +Normally you would use a combination of B<--table> and B<--column> options. +For example, if you have a database table C<hosts>, which has a column C<ip>, +that holds IP address in dotted-quad form, you would use the following options: + + --table=hosts --column=ip + +If the table holds IP addresses in numeric form, use the following instead +(MySQL is assumed): + + --table=hosts --column='INET_NTOA(ip)' + +Finally, if a complex query is needed to extract IP addresses (e.g. joining +several tables, etc.), supply it in full, via the B<--query> option. + +=head2 Informative options + +=over 4 + +=item B<-?> + +Display short help summary. + +=item B<--usage> + +Display command line usage summary. + +=item B<--help> + +Display a detailed program manual. + +=back + +=head1 SEE ALSO + +L<ping903>, +L<DBI>, +L<mangemache>. + +=cut + + diff --git a/lib/App/Ping903/Command/ident.pm b/lib/App/Ping903/Command/ident.pm index d985f29..67cebd9 100644 --- a/lib/App/Ping903/Command/ident.pm +++ b/lib/App/Ping903/Command/ident.pm @@ -47,7 +47,27 @@ package version an running instance PID. If given a single argument I<PARAM>, only the requested parameter is displayed. + +=head1 OPTIONS +=head2 Informative options + +=over 4 + +=item B<-?> + +Display short help summary. + +=item B<--usage> + +Display command line usage summary. + +=item B<--help> + +Display a detailed program manual. + +=back + =head1 SEE ALSO L<ping903>(1), L<ping903.conf>(5). diff --git a/lib/App/Ping903/Command/inspect.pm b/lib/App/Ping903/Command/inspect.pm index 9347e54..6c4a11b 100644 --- a/lib/App/Ping903/Command/inspect.pm +++ b/lib/App/Ping903/Command/inspect.pm @@ -50,6 +50,26 @@ prints it on screen in its configuration file format. If given a single argument I<PARAM>, only the requested configuration parameter is displayed. + +=head1 OPTIONS + +=head2 Informative options + +=over 4 + +=item B<-?> + +Display short help summary. + +=item B<--usage> + +Display command line usage summary. + +=item B<--help> + +Display a detailed program manual. + +=back =head1 NOTES diff --git a/lib/App/Ping903/Command/ipadd.pm b/lib/App/Ping903/Command/ipadd.pm index a516aba..443c052 100644 --- a/lib/App/Ping903/Command/ipadd.pm +++ b/lib/App/Ping903/Command/ipadd.pm @@ -14,3 +14,44 @@ sub run { } } 1; + +=head1 NAME + +ipadd - adds a single IP to the ping903 ip list + +=head1 SYNOPSIS + +B<ipadd> I<IP> + +=head1 DESCRIPTION + +Adds I<IP> to the mutable IP list of the running B<ping903> daemon. + +=head1 OPTIONS + +=head2 Informative options + +=over 4 + +=item B<-?> + +Display short help summary. + +=item B<--usage> + +Display command line usage summary. + +=item B<--help> + +Display a detailed program manual. + +=back + +=head1 SEE ALSO + +L<ping903>, +L<mangemache>, +L<ipdel>. + +=cut + diff --git a/lib/App/Ping903/Command/ipdel.pm b/lib/App/Ping903/Command/ipdel.pm index 3c14779..45ca0d7 100644 --- a/lib/App/Ping903/Command/ipdel.pm +++ b/lib/App/Ping903/Command/ipdel.pm @@ -14,3 +14,42 @@ sub run { } } 1; +=head1 NAME + +ipdel - deletes a single IP from the ping903 mutable ip list + +=head1 SYNOPSIS + +B<ipdel> I<IP> + +=head1 DESCRIPTION + +Deletes I<IP> from the mutable IP list of the running B<ping903> daemon. + +=head1 OPTIONS + +=head2 Informative options + +=over 4 + +=item B<-?> + +Display short help summary. + +=item B<--usage> + +Display command line usage summary. + +=item B<--help> + +Display a detailed program manual. + +=back + +=head1 SEE ALSO + +L<ping903>, +L<mangemache>, +L<ipadd>. + +=cut |