=head1	NAME

klpinfo - Get short printer status using SNMP

=head1	SYNOPSIS

  klpinfo [<options>]

=head1	DESCRIPTION

The program prints a short printer status message. It uses SNMP to retrieve
the printer status, the OIDs
``HOST-RESOURCES-MIB::hrDeviceStatus'' and
``HOST-RESOURCES-MIB::hrPrinterStatus'' are retrieved. No snmpyalc.cfg file
is needed but in yanolc.cfg we need an ``snmp'' entry for the print queue
to find host, SNMP version and SNMP community. A dummy SNMP type name can
be used.

=head1	OPTIONS

=over	6

=item	B<-S> I<server>

connects to the specified print server host. The server can be specified
either by hostname or IP address. If this option is not used and there
is no host name given using the B<-P> option the program tries to find
a default print host in the following places:

=over	8

=item	the "PRINTHOST" environment variable,

=item	the "/yalc/print-host" user preference

=item	the "/print-host" registry entry in HKCU/Software/DKrause/Yalc

=item	the "/yalc/print-host" system preference

=item	the "/print-host" registry entry in HKLM/Software/DKrause/Yalc

=back

Alternative option: B<-H> I<server>

Long option: B<--server=>I<server>

=item	B<-P> I<printer>

chooses a print queue. The print queue can be specified as alias, or
using queue@host or host%port.

If the B<-P> option is not used the program searches for a printer
name in the following places:

=over	8

=item	the "NGPRINTER", "NPRINTER", "LPDEST" and "PRINTER" environment
variables,

=item	the "/yalc/default-printer" user preference,

=item	the "/default-printer" registry entry in HKCU/Software/DKrause/Yanolc,

=item   the "/yalc/default-printer" system preference,

=item   the "/default-printer" registry entry in HKLM/Software/DKrause/Yanolc.

=back

If the queue name doest not contain a host information, the print
server host information is retrieved from the B<-S> option.

Long option: B<--printer=>I<printer>

=item	B<-C> I<community>

specifies the SNMP community name.

Long option: B<--community=>I<community>

=item	B<-V> I<protocol>

specifies the SNMP protocol, ``1'', ``2'', ``2c'', ``2p'' or ``3''.

Long option: B<--version=>I<protocol>

=item	B<-i>

sets exit status code to 0, no matter if there was an error.

Long option: B<--ignore-exit-code>

=item	B<-s>

enforces silent run (no error messages or warnings shown).

Long option: B<--silently>

=item	B<-f>

forces output. If no status is found, print ``-'' to have at least
some non-whitespace in output.

Long option: B<--force>

=item	B<-l>

write device and printer status too.

Long option: B<--long-output>

=back

=head1	RETURN VALUE

The program returns exit status code 0 on success, any other value indicates
an error.

=head1	FILES

=over	6

=item	B<yanolc.conf>

see yanolc(1).

=back

=head1	SEE ALSO

yanolc(1), http://dktools.sourceforge.net/yanolc.html

=head1	AUTHOR

Dirk Krause

=head1	COPYRIGHT AND LICENSE

Copyright (c) 2001-2008, Dirk Krause
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above
   copyright notice, this list of conditions and the
   following disclaimer.

 * Redistributions in binary form must reproduce the above
   copyright notice, this list of conditions and the following
   disclaimer in the documentation and/or other materials
   provided with the distribution.

 * Neither the name of the Dirk Krause nor the names of
   contributors may be used to endorse or promote products
   derived from this software without specific prior written
   permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

