From 4dcd4d96b7b1a2a0880a374f142c160df259c648 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Mon, 2 Mar 2020 13:49:06 +0000 Subject: Document particular commands. --- lib/App/Ping903/Command/dbload.pm | 148 +++++++++++++++++++++++++++++++++++++ lib/App/Ping903/Command/ident.pm | 20 +++++ lib/App/Ping903/Command/inspect.pm | 20 +++++ lib/App/Ping903/Command/ipadd.pm | 41 ++++++++++ lib/App/Ping903/Command/ipdel.pm | 39 ++++++++++ 5 files changed, 268 insertions(+) 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 +[B<-D> I] +[B<-P> I] +[B<-c> I] +[B<-d> I] +[B<-h> I] +[B<-p> I] +[B<-q> I] +[B<-t> I] +[B<-u> I] +[B<--column>=I] +[B<--database>=I] +[B<--defaults-file>=I] +[B<--driver>=I] +[B<--host>=I] +[B<--params>=I] +[B<--password>=I] +[B<--port>=I] +[B<--query>=I] +[B<--table>=I
] +[B<--user>=I] + +=head1 DESCRIPTION + +Reads IP addresses from the database and adds them to the list of monitored +hosts of L. + +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 + +Sets L database driver name. Default is C. + +=item B<-h>, B<--host>=I + +Name or IP address of the database server. + +=item B<-P>, B<--port>=I + +Port number the database server listens on. + +=item B<-d>, B<--database>=I + +Name of the database to use. + +=item B<-u>, B<--user>=I + +Database user name. + +=item B<-p>, B<--password>=I + +Database password. + +=item B<--defaults-file>=I + +Name of the MySQL defaults file to use. This option is used only if DBI +driver B is used. By default, the file F<.my.cnf> in the home +directory is used, if it exists. + +=item B<--params>=I + +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
+ +Name of the table which holds IP addresses. + +=item B<-c>, B<--column>=I + +Name of the column in I
where IP address is stored. If need +be, you can use SQL expression as well. + +=item B<-q>, B<--query>=I + +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, which has a column C, +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, +L, +L. + +=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, 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(1), L(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, 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 I + +=head1 DESCRIPTION + +Adds I to the mutable IP list of the running B 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, +L, +L. + +=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 I + +=head1 DESCRIPTION + +Deletes I from the mutable IP list of the running B 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, +L, +L. + +=cut -- cgit v1.2.1