Compare commits

...

No commits in common. "pristine-tar" and "master" have entirely different histories.

864 changed files with 100299 additions and 3 deletions

41
.gitignore vendored Normal file
View File

@ -0,0 +1,41 @@
autom4te.cache
subst
summary
*Makefile
config.log
config.status
scripts/rc.npcd
scripts/rc.pnp_gearman_worker
scripts/check_pnp_rrds.pl
scripts/process_perfdata.pl
scripts/rrd_modify.pl
src/*.o
src/npcd
include/config.h
*~
sample-config/pnp/config.php
sample-config/pnp/pnp4nagios_release
sample-config/pnp/process_perfdata.cfg-sample
sample-config/pnp/npcd.cfg-sample
sample-config/misccommands.cfg-sample
sample-config/nagios.cfg-sample
share/pnp/application/config/config.php
share/pnp/index.php
share/pnp/install.php
sample-config/httpd.conf
share/pnp/application/logs/*
contrib/ssi/status-header.ssi
helpers/w2h.pl
scripts/verify_pnp_config.pl
sample-config/lighttpd.pnp4nagios.conf
sample-config/nginx.pnp4nagios.conf
share/pnp/media/js/basket.js
scripts/rrd_convert.pl
scripts/rrd_converter.pl
man/npcd.8
*.swp
*.swo

3
AUTHORS Normal file
View File

@ -0,0 +1,3 @@
Authors:
Jörg Linge pitchfork@pnp4nagios.org
Hendrik Bäcker andurin@process-zero.de

340
COPYING Normal file
View File

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

199
ChangeLog Normal file
View File

@ -0,0 +1,199 @@
**pnp-0.6.?? ??/??/2017**
**pnp-0.6.26 08/21/2017**
* Bugfix: Use complete option arguments for compatibility with rrdtool 1.6.0 (sbraz)
* Bugfix: Zoom on a special template not possbile (stinnux)
* Update: Update for FPDF (1.81) and FPDI (1.6.1) (Jan T. Bein )
* Bugfix: address behaviour of rrdtool1.5+ tp not export timestamp by default
* Feature: Template for icinga2's built-in icinga check (Tontonitch)
* Bugfix: fix non well formed numeric value encountered (sni)
**pnp-0.6.25 01/03/2015**
* Update: FPDF Update to Version 1.7
* Bugfix: Default source fixed by AWiddersheim
* Bugfix: Fixed urlencoding of Host- and Servicenames by Andreas Doehler
* Bugfix: Fixed Timeranges by AWiddersheim
**pnp-0.6.24 07/30/2014**
* Bugfix: Fixed some more XSS issues
* Bugfix: Fixed PHP issue while running on PHP 5.6 ( Reported by Sven Nierlein )
**pnp-0.6.22 06/04/2014**
* Bugfix: Fixed livestatus socket parsing ( Pekka Panula )
* Bugfix: Update check_mssql_health.php ( Miriam Zenk )
* Feature: Add "version=tiny" to got get a stripped down version of graph ( Ricardo Bartels )
* feature: Add STDIN Mode to process_perfdata.pl ( Robert Steininger )
* Bugfix: XSS issue fixed by Mikael Falkvidd. This issue was detected by Peter Österberg at Hexbit AB in a security assessment of op5 Monitor 6.3 on assignment by op5 AB.
**pnp-0.6.21 03/24/2013**
* Feature: Helper functions rrd::alerter and rrd:alerter_gr both supports treshold detection (Martin Schirrmacher)
* Update: jQuery Mobile update to 1.3.0 ( was broken in 0.6.20 )
**pnp-0.6.20 03/03/2013**
* Feature: Support check_mk Multisite Cookie Auth ( Lars Michelsen )
* Feature: Allow RRD unknown values ( Simon Meggle )
* feature: Interactive delete mode added to check_rrds.pl ( Simon Meggle )
* Bugfix: Allow multiple gearman servers ( Craig Barraclough )
* Bugfix: Fixed Graph Search ( Stefan Triep )
* Update: jQuery update to 1.8.1
* Update: jQueryUI update to 1.8.23
**pnp-0.6.19 09/01/2012**
* Feature: Parameter "width" added to popup controller ( Andreas Doehler )
* Fix: simplify/improve apache rules ( Christoph Anton Mitterer )
* Fix: Check for missing PHP GD functions
* Bugfix: socketDOMAIN changed to AF_INET while using livstatus tcp socket ( Rene Koch )
**pnp-0.6.18 06/28/2012**
* Bugfix: Fixed STORAGE_TYPE and CUSTOM_TEMPLATE vars used in custom templates
* Bugfix: Blank screen on PHP 5.4 fixed
* Feature: Allow multiple gearman job servers
* Feature: New helper function rrd::debug()
* Feature: New templates check_jmx4perl_*.php
**pnp-0.6.17 03/25/2012**
* Bugfix: Fixed rrd_convert.pl while running with --dry-run
* Bugfix: logging.c include missing header files ( Lars Vogdt )
* Bugfix: Check if pnp4nagios/etc/rra.cfg is readable
* Bugfix: rrd_convert.pl use XML tag TEMPLATE instead of CHECKCOMMAND to selects RRDs ( Sven Velt )
* Feature: npcdmod.o increase perfdata buffer and log discarded perfdata ( Birger Schmidt )
* Feature: rrd_modify.pl to change number of data sources of an RRD file
* Feature: New template check_apachestatus_auto.php
* Feature: Implement etc/config.d to place config snippets ( Lars Michelsen )
**pnp-0.6.16 11/21/2011**
* Bugfix: Fixed single quoted check_multi labels (Reported by Matthias Flacke)
* Bugfix: Append missing slash to perfdata_spool_dir ( Reported by Juergen-Michael Radtke )
* Bugfix: Fixed jQuery-ui multisite theme
* Feature: PDF margins are now adjustable via config.php ( Thomas Witzenrath )
* Feature: Support for PDF size 'letter' added ( Robert Becht )
**pnp-0.6.15 09/15/2011**
* Bugfix: Fixed Overview link (reported by Stefan Triep)
* Bugfix: Fixed zoom popup (reported by Rudolf Labuschagne)
* Bugfix: Fixed double urlencode() (reported by Mathias Kettner)
* Feature: "Clear basket" button added (suggested by Stefan Triep)
* Feature: New helper function "rrd::alerter_gr()" ( committed by Stefan Trip )
**pnp-0.6.14 08/05/2011**
* Feature: Webinterface for mobile devices based on jQuery Mobile \\ ( http://jquerymobile.com/ )
* Feature: Zoom based on jQuery plugin imgAreaSelect \\ ( http://odyniec.net/projects/imgareaselect/ )
* Feature: New template check_mssql_health.php
* Bugfix: Fixed popups to work under nginx ( Joram Agten )
* Bugfix: Helper rrd::vdef() fixed
* Update: jQuery update to 1.6.2
* Update: jQuery-ui update to 1.8.14
**pnp-0.6.13 05/19/2011**
* Feature: New option --ignore-hosts added to check_pnp_rrds.pl ( by Jochen Bern )
* Feature: New options zgraph_width and zgraph_height in config.php ( Mike Liebsch )
* Bugfix: rrd_convert.pl: parse_xml_filename() regex fix
* Info: Version used by OMD-0.48 [[http://omdistro.org|OMD]]
**pnp-0.6.12 04/22/2011**
* Feature: mod_gearman support added
* Feature: rrd_convert.pl is now able to convert all RRDs from RRD_STORAGE_TYPE=SINGLE to RRD_STORAGE_TYPE=MULTIPLE
* Feature: New template check_gearman.php
* Feature: Install process_perfdata.cfg and npcd.cfg by default
* Bugfix: rrd_convert.pl is now able to parse xml dumps created by rrdtool 1.4.x
* Bugfix: process_perfdata.pl default timeout value set to 15 seconds
**pnp-0.6.11 01/15/2011**
* Bugfix: urldecoding fixed
* Bugfix: Zoom in/out is working again ( Reported by Thorben Soehl )
* Featue: npcd.cfg - New option perfdata_file_processing_interval used by npcdmod
* Info: Version used by OMD-0.46 [[http://omdistro.org|OMD]]
**pnp-0.6.10 12/15/2010**
* Feature: Add RRDTool Option --only-graph if graph height is below 32px to create thumbnails
* Feature: RRDTool Option --width and --height is now allowed in templates
* Feature: RRDTool DS Type for UOM of "c" changed from COUNTER to DERIVE
* Feature: Pass query string from special controller to image controller ( Matthew Garrett )
* Feature: Authorisation against [[http://mathias-kettner.de/checkmk_livestatus.html|mk_livestatus]] API added
* Feature: Sample nginx webserver config added ( by evax@users.sourceforge.net )
* Feature: Kohana backport to support PHP 5.1.6 ( Kudos to Andreas Ericsson )
* Bugfix: Sort list of special templates
* Bugfix: Urlencode hostname and service description ( Reported by Yannick )
* Bugfix: corrected warning/critical thresholds in ticker/alerter functions
**pnp-0.6.7 09/27/2010**
* Bugfix: Page config parser fix (Beau Gunderson)
* Bugfix: Zoom window size fixed (Report by Rudolf Labuschagne)
* Bugfix: Fixed undefined offset while using 'ds_name' in templates (Reported by Vladimir Bilik)
* Bugfix: Npcdmod respects process_perf_data option used in hosts and services definitions ( Reported by Wolfgang Barth )
* Template: New Template check_nagiostats.php used with check_nagiostats written by Jochen Bern
**pnp-0.6.6 08/07/2010**
* Bugfix: Fixed max amount of graphs per template
* Bugfix: Autodetect PNP base URL
* Bugfix: Too short npcdmod perfdata_template to take perfdata + overhead, increased +1024byte
* Bugfix: Ignore files in var/perfdata and check for empty directories
* Bugfix: Reducing memory usage while parsing page config (Laurent Freval)
**pnp-0.6.5 07/09/2010**
* Feature: Special Templates are back [[tpl_special]]
* Feature: New rrdtool helper functions makes template design easier [[tpl_helper]]
* Feature: config.php -> 'recursive_template_search' is enabled by default
* Feature: config.php -> 'template_dirs' is now an array of directorys to search for PNP templates
**pnp-0.6.4 06/03/2010**
* Update: jQuery Update to 1.4.2
* Update: jQuery-ui Update to 1.8
* Feature: New configure Option --with-base-url
* Template: New template check_ntp_time.php (Mathias Kettner)
* Feature: New i18n files for fr_FR (Yannig Parre)
* Feature: New jQuery Theme 'multisite'
**pnp-0.6.3 03/16/2010**
* Feature: New helper script libexec/rrd_convert.pl -> [[rrd_convert]]
* Bugfix: Ignore old XML files while building the service list
* Template: New template check_hpasm.php
* Bugfix: Installer now checks for json_decode()
* Workaround: Allow "trailing unfilled semicolons". Workaround for nsclient++
* Template: Updates for check_openmanage.php, check_hp_bladecenter.php and check_dell_baldecenter.php ( Trond Hasle Amundsen )"
**pnp-0.6.2 12/23/2009**
* Feature: XML_WRITE_DELAY option added to process_perfdata.cfg as suggested by Mathias Kettner
* Feature: New template integer.php
* Update: FPDI update to 1.3.1
* Feature: PNP will now work with [[http://http://www.lighttpd.net|lighttpd]] and php-cgi
* Template: check_mk-ps.perf.php added ( by Mathias Kettner )
* Feature: PNP will now work without mod_rewrite -> [[webfe]]
* Bugfix: Wrong pdf link used on site 'pages' and 'basket'
* Bugfix: Incorrect group permissions on spool directory
**pnp-0.6.1 11/22/2009**
* Feature: RRD heartbeat per check_command -> [[tpl_custom]]
* Feature: New config.php option pdf_graph_opt
* Feature: Recognize the 'background_pdf' option in page definitions -> [[pages]]
* Feature: Recognize the 'source' option in page definitions -> [[pages]]
* Feature: Array $TIMERANGE now available for templates -> [[timeranges]]
* Bugfix: ./configure --sysconfdir no longer ignored
* Feature: Store internal runtime statistics on a per minute base
* Feature: Added two widgets views/widget_menu.php and views/widget_graph.php
**pnp-0.6.0 10/30/2009**
* Webfrontend based on [[http://www.kohanaphp.com|Kohana]]
* Webfrontend based on [[http://jqueryui.com/themeroller/|jQuery Themes]]
* Javascript-functions using [[http://jquery.com/|jQuery]] plugins
* process_perfdata.pl will be able to use one RRD database per datasource
* improved installer. Specification of directory layouts using --with-layout
* RRDtool errors are now displayed as images. no more missing images
* PNP templates cannot overwrite internal variables anymore
* PNP templates of version 0.4.x can still be used
* PDF functions recoded
* Template default.php optimized
* Export from RRD databases into XML, CSV and JSON format using the RRDtool "xport" function
* Page functions recoded
* Error pages links to online FAQ
* Mouseover Popup in Nagios frontend via jQuery.clueTip plugin
* Full support of rrdcached

236
INSTALL Normal file
View File

@ -0,0 +1,236 @@
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script). Here is a another example:
/bin/bash ./configure CONFIG_SHELL=/bin/bash
Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
configuration-related scripts to be executed by `/bin/bash'.
`configure' Invocation
======================
`configure' recognizes the following options to control how it operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

183
Makefile.in Normal file
View File

@ -0,0 +1,183 @@
###############################
# Makefile for PNP
#
# Last Modified: 12-10-2006
###############################
# Source code directories
SRC_BASE=@srcdir@/src
SRC_SHARE=@srcdir@/share
SRC_LIB=@srcdir@/lib
SRC_SCRIPTS=@srcdir@/scripts
SRC_CONFIG=@srcdir@/sample-config
SRC_MAN=@srcdir@/man
SRC_CONTRIB=@srcdir@/contrib
SRC_HELPERS=@srcdir@/helpers
CC=@CC@
CFLAGS=@CFLAGS@ @DEFS@
LDFLAGS=@LDFLAGS@ @LIBS@
prefix=@prefix@
exec_prefix=@exec_prefix@
LOGDIR=@localstatedir@
CFGDIR=@sysconfdir@
BINDIR=@bindir@
LIBEXECDIR=@libexecdir@
LIBDIR=@libdir@
KOHANA=@KOHANA@
CGIDIR=@sbindir@
INSTALL=@INSTALL@
INSTALL_OPTS=@INSTALL_OPTS@
DATAROOTDIR=@datarootdir@
CP=@CP@
PERL=@PERL@
none:
@echo "Please supply a command line argument (i.e. 'make all'). Other targets are:"
@echo " clean"
@echo " install install-init install-config install-processperfdata install-html fullinstall"
@echo " install-plugins"
all:
cd $(SRC_BASE) && $(MAKE)
cd $(SRC_SHARE) && $(MAKE)
cd $(SRC_SCRIPTS) && $(MAKE)
chmod a+r $(SRC_CONTRIB)/ssi/status-header.ssi
@echo ""
@echo "*** Compile finished ***"
@echo ""
@echo " make install"
@echo " - This installs the main program and HTML files"
@echo ""
@echo " make fullinstall"
@echo " - This installs the main program, runlevel scripts, config and HTML files"
@echo ""
@echo "Enjoy."
@echo ""
scripts:
cd $(SRC_SCRIPTS) && $(MAKE)
share:
cd $(SRC_SHARE) && $(MAKE)
clean:
cd $(SRC_BASE) && $(MAKE) $@
cd $(SRC_MAN) && $(MAKE) $@
cd $(SRC_SHARE) && $(MAKE) $@
cd $(SRC_LIB) && $(MAKE) $@
cd $(SRC_SCRIPTS) && $(MAKE) $@
cd $(SRC_CONFIG) && $(MAKE) $@
-rm -f *.cfg core
-rm -f *~ *.*~ */*~ */*.*~
-rm -f config.log config.status config.cache
distclean:
cd $(SRC_BASE) && $(MAKE) $@
cd $(SRC_MAN) && $(MAKE) $@
cd $(SRC_SHARE) && $(MAKE) $@
cd $(SRC_LIB) && $(MAKE) $@
cd $(SRC_SCRIPTS) && $(MAKE) $@
cd $(SRC_CONFIG) && $(MAKE) $@
-rm -f *.cfg core
-rm -f *~ *.*~ */*~ */*.*~
-rm -f config.log config.status config.cache
rm -f Makefile include/stamp-h1 include/config.h config.status config.log
rm -f subst summary
rm -f $(SRC_CONTRIB)/ssi/status-header.ssi
devclean: distclean
install-html:
cd $(SRC_SHARE) && $(MAKE) install
install-base:
cd $(SRC_BASE) && $(MAKE) install
install-man:
cd $(SRC_MAN) && $(MAKE) install
install-processperfdata:
cd $(SRC_SCRIPTS) && $(MAKE) install
install-init:
cd $(SRC_SCRIPTS) && $(MAKE) $@
install-config:
cd $(SRC_CONFIG) && $(MAKE) $@
@echo ""
@echo "*** PNP4Nagios sample config files installed ***"
@echo ""
@echo "Please run 'make install-init' if you want to use"
@echo "BULK Mode with NPCD"
@echo ""
@echo ""
@echo ""
install-webconf:
cd $(SRC_CONFIG) && $(MAKE) $@
@echo ""
@echo "*** Apache config file installed ***"
@echo ""
@echo "Restart your apache webserver to activete your changes."
@echo ""
@echo "Please run 'make install-config' to install sample"
@echo "configuration files"
@echo ""
@echo "Please run 'make install-init' if you want to use"
@echo "BULK Mode with NPCD"
@echo ""
@echo ""
@echo ""
install-plugins:
cd $(SRC_SCRIPTS) && $(MAKE) $@
install:
cd $(SRC_BASE) && $(MAKE) $@
cd $(SRC_MAN) && $(MAKE) $@
cd $(SRC_SHARE) && $(MAKE) $@
if [ x$(KOHANA) = xyes ]; then \
cd $(SRC_LIB) && $(MAKE) $@; \
fi
cd $(SRC_SCRIPTS) && $(MAKE) $@
cd $(SRC_CONFIG) && $(MAKE) $@
@echo ""
@echo "*** Main program, Scripts and HTML files installed ***"
@echo ""
@echo "Please run 'make install-webconf' to install the"
@echo "web configuration file"
@echo ""
@echo "Please run 'make install-config' to install sample"
@echo "configuration files"
@echo ""
@echo "Please run 'make install-init' if you want to use"
@echo "BULK Mode with NPCD"
@echo ""
@echo ""
@echo ""
install-unstripped:
cd $(SRC_BASE) && $(MAKE) $@
cd $(SRC_SHARE) && $(MAKE) $@
cd $(SRC_SCRIPTS) && $(MAKE) $@
$(MAKE) install-basic
fullinstall: install install-webconf install-config install-init
$(PERL) summary fullinstall
@echo ""
@echo "*** Main program, Scripts and HTML files installed ***"
@echo ""
@echo "Enjoy."
@echo ""

10
README Normal file
View File

@ -0,0 +1,10 @@
#########################
# #
# README #
# #
#########################
See our online documentation at:
http://pnp4nagios.sourceforge.net or:
http://docs.pnp4nagios.org/

85
THANKS Normal file
View File

@ -0,0 +1,85 @@
###########################################
# PNP Thanks #
###########################################
Olivier PLATHEY - For providing FPDF
Sven Nierlein - For providing mod_gearman
Michal Wojciechowski - For providing imgAreaSelect
Hendrik Baecker - Testing, debugging and english Translation
Olaf Reiss - Testing
Andreas Koch - Testing
Christian Mies - check_nwstat Templates, Testing
Sebastian Schubert - Internal Design
Stephan von Gehlen - Testing and Feedback
Geoffrey Walton - Feedback and Translation
Frank J. Heym - process_perfdata.pl Patch for check_nrpe Templates
Rudolf Labuschagne - Testing PNP in distributed setups
Sven Velt - Multigraph Layout
Sonja Scholz - Documentation
Andrea Gabellini -
Matthias Flittener - Bugreport
Ton Kersten - Dutch Language
Matthias Flacke - check_multi development, npcd load patch
Markus Dorfer -
Christian Claus - Debugging 64bit Counter
Herbert Straub
Wolfgang Nieder - English translation, verify-script, nitpicking
Max Schubert -
Wolfgang Barth -
Ethan Galstad - Patches and Feedback
Jan Dreyer - Solaris debugging
Jean-Marie Le Borgne - French Translation
Steffen Waitz - ./configure Patch
Lars Michelsen -
Philipp Deneu -
Thomas Stolle - Debugging and testing
Benjamin Ritcey - Patches
Franky Van Liedekerke - Testing
Simon Meggle - Testing / Patches
Mattias Ryrlén - Patches
Nicolas Graziano - Patches
Joe Precious - Testing
Stefan Priebe - Patches
Carlos de Nova - i18n
Stefan Hoesl - Testing
Trond Hasle Amundsen - Template check_openmanage
Silvan Hunkirchen - Bugreport
Petr Maizner - Bugreport
Steve Finkelstein - Bugreport
Mathias Kettner - xml write delay
Yannig Parre - i18n fr_FR
Laurent Freval - Patches and feedback
Beau Gunderson - Patches and feedback
Thomas Sesselmann - Patches and feedback
Vladimir Bilik - Feedback
Matthew Garrett -
Thomas Charbonnel - nginx webserver config
Richard Allen - Patches and feedback
Falko Koglin - Patches
Jochen Bern - Patches
Mike Liebsch - Patches
Joram Agten - Patches
Juergen-Michael Radtke - Bugreport
Robert Becht - Feedback
Lars Vogdt - Patches
Birger Schmidt - Patches
Andreas Doehler - Patches
Christoph Anton Mitterer - Patches and feedback
Rene Koch - Patches
Craig Barraclough - Patches
Martin Schirrmacher - Patches
Pekka Panula - Bugreport
Dennis Lamers - Bugreport and Patches
Robert Steininger - Patches
Ricardo Bartels - Patches
Miriam Zenk - Patches
###########################################
# NPCD Thanks #
###########################################
Joerg Linge - for giving so much ideas what I have to do ;)
Ethan Galstad - for many useful code to learn from
Carsten Schlosser - for all the time I can disturb him to ask silly pointer questions
My Girlfriend Katrin (without 'h') - for spending so much time without me

1526
config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

1658
config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

7104
configure vendored Executable file

File diff suppressed because it is too large Load Diff

313
configure.ac Normal file
View File

@ -0,0 +1,313 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT(pnp, 0.6.26, pnp4nagios-devel@lists.sourceforge.net)
AC_CONFIG_SRCDIR(src/)
AC_CONFIG_HEADERS(include/config.h:include/config.h.in)
AC_PREFIX_DEFAULT(/usr/local/pnp4nagios)
AC_DEFINE([DEFAULT_NAGIOS_USER], [nagios], [Default Nagios User])
AC_DEFINE([DEFAULT_NAGIOS_GROUP], [nagios], [Default Nagios Group])
PKG_NAME=pnp4nagios
PKG_VERSION="0.6.26"
PKG_HOME_URL="http://www.pnp4nagios.org/pnp/start"
PKG_REL_DATE="08-21-2017"
AC_SUBST(PKG_NAME)
AC_SUBST(PKG_VERSION)
AC_SUBST(PKG_HOME_URL)
AC_SUBST(PKG_REL_DATE)
AC_SUBST(ac_configure_args)
XML_STRUCTURE_VERSION="4"
AC_SUBST(XML_STRUCTURE_VERSION)
dnl Figure out how to invoke "install" and what install options to use.
AC_PROG_INSTALL
AC_SUBST(INSTALL)
#dnl What OS are we running?
AC_CANONICAL_HOST
dnl Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PATH_PROG([STRIP],[strip],[true])
AC_PATH_PROG(CP,cp)
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
#AC_CHECK_HEADERS(netinet/in.h string.h sys/socket.h unistd.h stdio.h stdlib.h getopt.h signal.h)
AC_CHECK_HEADERS(dirent.h stdio.h errno.h unistd.h syslog.h signal.h stdlib.h dirent.h string.h pthread.h getopt.h grp.h pwd.h sys/mman.h sys/types.h sys/wait.h sys/stat.h sys/socket.h sys/loadavg.h netinet/in.h fcntl.h limits.h)
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_TYPE_UID_T
# Checks for structure members
#AC_CHECK_MEMBER([struct dirent.d_type], [AC_MSG_RESULT([We successfully have a `dirent_d_type'!])],
# [AC_MSG_ERROR([We need `dirent.d_type'!])],
# [#include <dirent.h>])
AC_STRUCT_DIRENT_D_TYPE
# Checks for library functions.
AC_FUNC_FORK
AC_CHECK_FUNCS([bzero socket alarm strerror strspn getloadavg])
AC_FUNC_MALLOC
AC_FUNC_STAT
AC_C_CONST
dnl Layout Methods
layout="default"
AC_ARG_WITH(layout,[ --with-layout=\[default,debian\] sets directory layout],layout=$withval)
case $layout in
debian)
prefix="/"
sysconfdir="/etc/${PKG_NAME}"
localstatedir="/var/log/${PKG_NAME}"
libexecdir="/usr/lib/${PKG_NAME}/libexec"
libdir="/usr/lib/${PKG_NAME}"
datarootdir="/usr/share/${PKG_NAME}/html"
PERFDATA_LOG="/var/log/${PKG_NAME}/perfdata.log"
PERFDATA_DIR="/var/lib/${PKG_NAME}/perfdata"
PERFDATA_SPOOL_DIR="/var/spool/${PKG_NAME}"
bindir="/usr/bin"
sbindir="/usr/sbin"
;;
default-0.4)
prefix="/usr/local/nagios"
sysconfdir="\${prefix}/etc/pnp"
localstatedir="\${prefix}/var"
libexecdir="\${prefix}/libexec"
datarootdir="\${prefix}/share/pnp"
libdir="\${prefix}/lib/pnp"
PERFDATA_LOG="\${prefix}/var/perfdata.log"
PERFDATA_DIR="\${prefix}/share/perfdata"
PERFDATA_SPOOL_DIR="\${prefix}/var/spool/perfdata"
;;
default)
PERFDATA_LOG="${localstatedir}/perfdata.log"
PERFDATA_DIR="${localstatedir}/perfdata"
PERFDATA_SPOOL_DIR="${localstatedir}/spool"
mandir="\${prefix}/man"
;;
esac
AC_ARG_WITH(kohana,[ --without-kohana does not install the kohana framework],KOHANA=no,KOHANA=yes)
AC_SUBST(KOHANA)
AC_ARG_WITH(kohana_system,[ --with-kohana_system=<existing kohana system dir> Points to an already installed kohana framework],KOHANA_SYSTEM=$withval,KOHANA_SYSTEM=$libdir/kohana/system)
AC_SUBST(KOHANA_SYSTEM)
AC_ARG_WITH(nagios_user,[ --with-nagios-user=<user> sets user name to run nagios],nagios_user=$withval,nagios_user=nagios)
AC_ARG_WITH(nagios_group,[ --with-nagios-group=<grp> sets group name to run nagios],nagios_grp=$withval,nagios_grp=nagios)
AC_SUBST(nagios_user)
AC_SUBST(nagios_grp)
AC_DEFINE_UNQUOTED(DEFAULT_NAGIOS_USER,"$nagios_user")
AC_DEFINE_UNQUOTED(DEFAULT_NAGIOS_GROUP,"$nagios_grp")
INSTALL_OPTS="-o $nagios_user -g $nagios_grp"
AC_SUBST(INSTALL_OPTS)
# Checks for programs.
AC_PATH_PROG(PERL,perl)
# Check for Perl lib path
PERL_LIB_PATH=no
AC_ARG_WITH(perl_lib_path,[ --with-perl_lib_path=<path_to_perl_libs> sets path to rrdtool RRDs perl modules.],PERL_LIB_PATH=$withval,PERL_LIB_PATH=no)
AC_SUBST(PERL_LIB_PATH)
# Check for rrdtool
RRDTOOL=no
AC_ARG_WITH(rrdtool,[ --with-rrdtool=<path_to_rrdtool> sets path to rrdtool],RRDTOOL=$withval,RRDTOOL=no)
if test RRDTOOL=no; then
AC_PATH_PROG(RRDTOOL,rrdtool)
fi
AC_MSG_CHECKING(rrdtool path $RRDTOOL)
if [ test -d $RRDTOOL ];then
AC_MSG_RESULT(no)
AC_MSG_ERROR([$RRDTOOL is a directory! PNP needs the Path to the rrdtool binary!])
fi
AC_MSG_RESULT(yes)
AC_MSG_CHECKING(for executable Bit on $RRDTOOL)
if [ ! test -x $RRDTOOL] ;then
AC_MSG_RESULT(no)
AC_MSG_ERROR([$RRDTOOL is not executable!])
fi
AC_MSG_RESULT(yes)
AC_SUBST(RRDTOOL)
AC_ARG_WITH(perfdata-logfile,[ --with-perfdata-logfile=<perfdata_logfile> Tell me where I should store the 'process_perfdata.pl' Logfile],
PERFDATA_LOG=$withval
)
AC_SUBST(PERFDATA_LOG)
AC_ARG_WITH(perfdata-dir,[ --with-perfdata-dir=<path_to_perfdata> Tell me where I should store the RRD Database Files],
PERFDATA_DIR=$withval
)
AC_SUBST(PERFDATA_DIR)
AC_ARG_WITH(perfdata-spool-dir,[ --with-perfdata-spool-dir=<path_to_perfdata_spool_dir> Tell me where I should store perfdata files for bulk mode with npcd],
PERFDATA_SPOOL_DIR=$withval
)
AC_SUBST(PERFDATA_SPOOL_DIR)
AC_ARG_WITH(debug,[ --with-debug Enable debuging for process_perfdata.pl],
DEBUG="2",
DEBUG="0"
)
AC_SUBST(DEBUG)
dnl Check for location of Apache conf.d directory
HTTP_CONF=no
AC_ARG_WITH(httpd_conf,[ --with-httpd-conf=<path_to_conf> sets path to Apache conf.d directory],HTTPD_CONF=$withval,HTTPD_CONF=no)
if test x$HTTPD_CONF = xno; then
if test -d /etc/httpd/conf.d; then
HTTPD_CONF="/etc/httpd/conf.d"
elif test -d /etc/apache2/conf.d; then
HTTPD_CONF="/etc/apache2/conf.d"
elif test -d /etc/apache/conf.d; then
HTTPD_CONF="/etc/apache/conf.d"
else
HTTPD_CONF="/etc/httpd/conf.d"
fi
fi
AC_SUBST(HTTPD_CONF)
dnl Check for location of init scripts
init_dir=/etc/rc.d/init.d
if test -d /etc/rc.d/init.d; then
init_dir="/etc/rc.d/init.d"
elif test -d /usr/local/etc/rc.d; then
init_dir="/usr/local/etc/rc.d"
elif test -d /etc/rc.d; then
init_dir="/etc/rc.d"
elif test -d /etc/init.d; then
init_dir="/etc/init.d"
elif test -d /sbin/init.d; then
init_dir="/sbin/init.d"
fi
BASE_URL=${PKG_NAME}
AC_ARG_WITH(base-url,[ --with-base-url=/${PKG_NAME} ],BASE_URL=$withval,BASE_URL=/${PKG_NAME})
AC_SUBST(BASE_URL)
dnl User can override init script location
AC_ARG_WITH(init_dir,[ --with-init-dir=<path> sets directory to place init script into],init_dir=$withval)
AC_SUBST(init_dir)
pnpsender_name=pnpsender
AC_SUBST(pnpsender_name)
npcd_name=npcd
AC_SUBST(npcd_name)
pp_pl_name=process_perfdata.pl
AC_SUBST(pp_pl_name)
dnl - Modified version from www.erlang.org
dnl - Some 12/15/05 mods made after reading http://xaxxon.slackworks.com/phuku/dl.html
AC_MSG_CHECKING(for linker flags for loadable modules)
case $host_os in
solaris2*|sysv4*)
MOD_LDFLAGS="-G"
;;
aix4*|aix5*|aix6*|aix7*)
#MOD_LDFLAGS="-G -bnoentry -bexpall"
MOD_LDFLAGS="-shared -Wl,-G -Wl,-bM:SRE -Wl,-bnoentry -Wl,-bexpall"
;;
freebsd2*)
# Non-ELF GNU linker
MOD_LDFLAGS="-Bshareable"
;;
darwin*)
# Mach-O linker, a shared lib and a loadable
# object file is not the same thing.
MOD_LDFLAGS="-bundle -flat_namespace -undefined suppress"
MOD_CFLAGS="$MOD_CFLAGS -fno-common"
;;
linux* | k*bsd*-gnu*)
# assume GNU linker and ELF
MOD_LDFLAGS="-shared"
MOD_CFLAGS="-fPIC"
;;
*)
# assume GNU linker and ELF
MOD_LDFLAGS="-shared"
;;
esac
AC_MSG_RESULT([$MOD_LDFLAGS])
AC_SUBST(MOD_CFLAGS)
AC_SUBST(MOD_LDFLAGS)
#
# Checking for Perl Modules
#
AC_MSG_CHECKING(for Perl Module Time::HiRes)
$PERL -MTime::HiRes -e exit >/dev/null 2>&1
if test $? -ne 0; then
AC_MSG_RESULT(no)
AC_MSG_ERROR(Perl Module Time::HiRes not available)
else
AC_MSG_RESULT(yes)
fi
AC_MSG_CHECKING(for Perl Module Getopt::Long)
$PERL -MGetopt::Long -e exit >/dev/null 2>&1
if test $? -ne 0; then
AC_MSG_RESULT(no)
AC_MSG_ERROR(Perl Module Getopt::Long not available)
else
AC_MSG_RESULT(yes)
fi
RRDS=0
AC_MSG_CHECKING(for optional Perl Module RRDs)
$PERL -I${PERL_LIB_PATH} -MRRDs -e exit >/dev/null 2>&1
if test $? -ne 0; then
AC_MSG_RESULT(no)
AC_MSG_WARN(Perl Module RRDs not available)
RRDS=0
else
AC_MSG_RESULT(yes)
RRDS=1
fi
AC_SUBST(RRDS)
AC_CONFIG_FILES( subst Makefile share/Makefile lib/Makefile scripts/Makefile src/Makefile sample-config/Makefile man/Makefile )
AC_OUTPUT()
$PERL subst summary
$PERL subst scripts/process_perfdata.pl
$PERL subst scripts/rrd_convert.pl
$PERL subst scripts/rrd_modify.pl
$PERL subst scripts/rc.npcd
$PERL subst scripts/rc.pnp_gearman_worker
$PERL subst scripts/check_pnp_rrds.pl
$PERL subst share/pnp/index.php
$PERL subst share/pnp/install.php
$PERL subst sample-config/httpd.conf
$PERL subst sample-config/lighttpd.pnp4nagios.conf
$PERL subst sample-config/nginx.pnp4nagios.conf
$PERL subst sample-config/nagios.cfg-sample
$PERL subst sample-config/misccommands.cfg-sample
$PERL subst sample-config/pnp/config.php
$PERL subst sample-config/pnp/npcd.cfg-sample
$PERL subst sample-config/pnp/process_perfdata.cfg-sample
$PERL subst sample-config/pnp/pnp4nagios_release
$PERL subst contrib/ssi/status-header.ssi
$PERL subst man/npcd.8
$PERL summary

View File

@ -0,0 +1,62 @@
Name: pnp4nagios
Version: 0.6.7
Release: 1
License: GNU Public License version 2
Packager: Olivier Raginel <babar@cern.ch>
Vendor: PNP4nagios team
URL: http://pnp4nagios.org
Prefix: /opt/pnp4nagios
Source: http://github.com/Babar/pnp4nagios/tarball/%{name}-%{version}.tar.gz
Group: Applications/Monitoring
Requires: perl(Gearman::Worker), perl(Crypt::Rijndael)
BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
Summary: Gearman version of pnp4nagios
Provides: pnp4nagios
%description
From the web page (http://docs.pnp4nagios.org/pnp-0.6/start):
PNP is an addon to Nagios which analyzes performance data provided by plugins
and stores them automatically into RRD-databases (Round Robin Databases, see
RRD Tool).
This is the version with support for Gearman, suitable to use with mod_gearman.
%prep
%setup -q
%build
./configure --with-nagios-user=nagios \
--with-nagios-group=nagios \
--prefix=%{_prefix} \
--libdir=%{_libdir}/%{name} \
--sysconfdir=%{_sysconfdir}/%{name} \
--localstatedir=%{_localstatedir} \
--with-init-dir=%{_initrddir} \
--with-layout=debian
%{__make} all
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_prefix}
%{__make} install fullinstall DESTDIR=$RPM_BUILD_ROOT INIT_OPTS= INSTALL_OPTS=
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%docdir %{_defaultdocdir}
%{_prefix}
%{_sysconfdir}
%defattr(-,nagios,root)
%{_localstatedir}
%changelog
* Wed Oct 21 2010 Olivier Raginel <babar@cern.ch>
- First build

128
contrib/pnp4nagios.spec Normal file
View File

@ -0,0 +1,128 @@
# $Id:$
# Upstream: pnp4nagios-devel@lists.sourceforge.net
Name: pnp4nagios
Version: 0.6.16
Release: 1
Summary: PNP is not PerfParse. A Nagios/Icinga perfdata graphing solution
Group: Applications/System
License: GPLv2
URL: http://www.pnp4nagios.org/
Source: http://downloads.sourceforge.net/pnp4nagios/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: rrdtool-devel
BuildRequires: perl-rrdtool
Requires: rrdtool
Requires: perl-rrdtool
Obsoletes: pnp
%description
PNP is an addon to Nagios/Icinga which analyzes performance data provided by plugins and stores them automatically into RRD-databases.
%prep
%setup
%build
sed -i -e 's/INSTALL_OPTS="-o $nagios_user -g $nagios_grp"/INSTALL_OPTS=""/' configure
sed -i -e 's/INIT_OPTS=-o root -g root/INIT_OPTS=/' scripts/Makefile.in
# hardcode that until a proper fix is upstream
sed -i -e 's/MANDIR=@mandir@/MANDIR=\/usr\/share\/man/' man/Makefile.in
%configure --with-perfdata-logfile=%{_localstatedir}/log/nagios/perfdata.log \
--sysconfdir=%{_sysconfdir}/%{name} \
--datarootdir=%{_datadir}/%{name} \
--with-perfdata-dir=%{_datadir}/%{name}/perfdata \
--with-perfdata-spool-dir=%{_localstatedir}/spool/nagios \
--mandir=%{_mandir} \
--libdir=%{_libdir}/%{name} # only kohana is installed there and maybe we have a system wide kohana already
make %{?_smp_mflags} all
%install
rm -rf %{buildroot}
%{__mkdir} -p %{buildroot}%{_sysconfdir}/httpd/conf.d/
make fullinstall DESTDIR=%{buildroot}
mv %{buildroot}%{_sysconfdir}/%{name}/check_commands/check_nwstat.cfg-sample %{buildroot}%{_sysconfdir}/%{name}/check_commands/check_nwstat.cfg
mv %{buildroot}%{_sysconfdir}/%{name}/pages/web_traffic.cfg-sample %{buildroot}%{_sysconfdir}/%{name}/pages/web_traffic.cfg
mv %{buildroot}%{_sysconfdir}/%{name}/rra.cfg-sample %{buildroot}%{_sysconfdir}/%{name}/rra.cfg
sed -i -e 's*log_file = /var/npcd.log*log_file = /var/log/nagios/npcd.log*' %{buildroot}%{_sysconfdir}/%{name}/npcd.cfg
# drop local versioning, we already provide our own upgrade safety
rm -f %{buildroot}%{_sysconfdir}/%{name}/config.php.%{version}
rm -f %{buildroot}%{_sysconfdir}/%{name}/config_local.php
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,nagios,nagios,-)
%doc AUTHORS
%doc ChangeLog
%doc COPYING
%doc INSTALL
%doc README
%doc THANKS
%config(noreplace) %{_sysconfdir}/%{name}/check_commands/check_all_local_disks.cfg-sample
%config(noreplace) %{_sysconfdir}/%{name}/check_commands/check_nrpe.cfg-sample
%config(noreplace) %{_sysconfdir}/%{name}/check_commands/check_nwstat.cfg
%config(noreplace) %{_sysconfdir}/%{name}/npcd.cfg
%config(noreplace) %{_sysconfdir}/%{name}/pages/web_traffic.cfg
%config(noreplace) %{_sysconfdir}/%{name}/process_perfdata.cfg
%config(noreplace) %{_sysconfdir}/%{name}/rra.cfg
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
%{_sysconfdir}/%{name}/background.pdf
%{_sysconfdir}/%{name}/config.php
%{_sysconfdir}/%{name}/misccommands.cfg-sample
%{_sysconfdir}/%{name}/nagios.cfg-sample
%{_sysconfdir}/%{name}/pnp4nagios_release
%attr(755,root,root) %{_sysconfdir}/rc.d/init.d/npcd
%attr(755,root,root) %{_sysconfdir}/rc.d/init.d/pnp_gearman_worker
%{_bindir}/npcd
%{_libdir}/pnp4nagios/npcdmod.o
%{_libdir}/%{name}
%{_libexecdir}/check_pnp_rrds.pl
%{_libexecdir}/process_perfdata.pl
%{_libexecdir}/rrd_convert.pl
%{_datadir}/%{name}
%{_mandir}/man8/npcd.8.gz
%changelog
* Mon Feb 06 2012 Michael Friedrich <michael.friedrich@univie.ac.at> - 0.6.16-1
- Updated to version 0.6.16.
- drop (Build)Requires nagios, we can use other core(s) as well
- verify_pnp_config.pl => verify_pnp_config_v2.pl not installed anymore
- npcd.cfg and process_perfdata.cfg get now installed by make install w/o -sample suffix
- recognize new initscript for pnp_gearman_worker
- autoremove versionized config.php, we use config(noreplace)
- drop config_local.php which would override default settings
- fix npcd.8 man page prefix install
* Tue Feb 15 2011 Christoph Maser <cmr@financial.com> - 0.6.11-1
- Updated to version 0.6.11.
* Tue Aug 31 2010 Christoph Maser <cmr@financial.com> - 0.6.6-1
- Updated to version 0.6.6.
* Thu Dec 24 2009 Christoph Maser <cmr@financial.com> - 0.6.2 - 2
- add --with-perfdata-spool-dir and --with-perfdata--dir
- mark httpd-config snippet as config file
* Thu Dec 24 2009 Christoph Maser <cmr@financial.com> - 0.6.2 - 1
- Update to version 0.6.2
- Rename to pnp4nagios
* Mon Mar 23 2009 Christoph Maser <cmr@financial.com> - 0.4.14 - 2
- Update to version 0.4.14
* Mon Mar 23 2009 Christoph Maser <cmr@financial.com> - 0.4.13 - 2
- modify log path
- add documentation files
* Mon Mar 23 2009 Christoph Maser <cmr@financial.com> - 0.4.13 - 1
- Initial package (using brain ;)

View File

@ -0,0 +1,9 @@
<script src="@BASE_URL@/media/js/jquery-min.js" type="text/javascript"></script>
<script src="@BASE_URL@/media/js/jquery.cluetip.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery('a.tips').cluetip({ajaxCache: false, dropShadow: false,showTitle: false });
});
</script>

93
debian/README.Debian vendored Normal file
View File

@ -0,0 +1,93 @@
PNP4Nagios for Debian
---------------------
PNP4Nagios supports several modes of operation. They differ in the way how
performance data is being processed and, thus, the efficiency of PNP. Detailed
documentation is available at <http://docs.pnp4nagios.org/pnp-0.6/modes>.
Using bulk mode for Nagios3
---------------------------
We recommend to use bulk mode with NPCD and npcdmod. This will facilitate an
easy installation and fast processing of performance data. To enable NPCD, set
'RUN' to 'yes' in /etc/default/npcd.
In order to enable processing of performance data in Nagios, please change the
"process_performance_data" statement in "/etc/nagios3/nagios.cfg" to
"process_performance_data=1".
To register the NPC event broker module (npcdmod), add the following line
(without quotes) to "/etc/nagios3/nagios.cfg":
"broker_module=/usr/lib/pnp4nagios/npcdmod.o config_file=/etc/pnp4nagios/npcd.cfg"
Finally reload your Nagios server by running "service nagios3 reload". All
performance data should be processed now.
Using bulk mode for Icinga
---------------------------
We recommend to use bulk mode with NPCD and npcdmod. This will facilitate an
easy installation and fast processing of performance data. To enable NPCD, set
'RUN' to 'yes' in /etc/default/npcd.
In order to enable processing of performance data in Icinga, please change the
"process_performance_data" statement in "/etc/icinga/icinga.cfg" to
"process_performance_data=1".
To register the NPC event broker module (npcdmod), copy the file
"/usr/share/doc/pnp4nagios-bin/examples/npcdmod.cfg" to
"/etc/icinga/modules"
Finally reload your Icinga server by running "service icinga reload". All
performance data should be processed now.
-- Markus Frosch <lazyfrosch@debian.org> Sun, 26 Oct 2014 15:49:10 +0100
Add links for PNP4Nagios to Nagios / Icinga Webfrontend
-------------------------------------------------------
If you want links to PNP4Nagios for your monitored hosts and services in the
Nagios web frontend just add
- "action_url /pnp4nagios/graph?host=$HOSTNAME$"
to your hosts or host template(s)
- "action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$"
to your services or service template(s)
For more information and different modes of operation, see
<http://docs.pnp4nagios.org/pnp-0.6/config>.
-- Sven Velt <sven@velt.de> Wed, 30 Sep 2009 13:55:35 +0000
Using Gearman mode
------------------
Starting with version 0.6.12, PNP4Nagios may operate as a Gearman worker. This
is useful in large, distributed setups using Nagios's mod_gearman. To use
the PNP Gearman worker, you'll need a running mod_gearman environment. See
<http://labs.consol.de/lang/en/nagios/mod-gearman/> for detailed setup
instructions.
In addition, the following configuration is required to get you started:
- Enable processing of performance data in Nagios: set
'process_performance_data=1' in "/etc/nagios3/nagios.cfg" or
"/etc/icinga/icinga.cfg" and reload your monitoring system:
"service nagios3 reload" / "service icinga reload".
- Enable the PNP Gearman worker daemon by setting 'RUN' to 'yes' in
/etc/default/pnp_gearman_worker. Check the Gearman related options in
"/etc/pnp4nagios/process_perfdata.cfg" (GEARMAN_HOST and encryption
settings) and start the Gearman worker: /etc/init.d/pnp_gearman_worker start
- Enable distribution of performance data in mod_gearman by setting the
'perfdata=yes' option.
When operating in Gearman mode, process_perfdata.pl requires the
Gearman::Worker, MIME::Base64, and Crypt::Rijndael Perl modules. These are
available in the libgearman-client-perl, perl, and libcrypt-rijndael-perl
Debian packages (see packages suggested by pnp4nagios-bin).
-- Sebastian Harl <tokkee@debian.org> Wed, 27 Apr 2011 09:32:52 +0200

4
debian/README.source vendored Normal file
View File

@ -0,0 +1,4 @@
This package uses quilt to manage all modifications to the upstream source.
See /usr/share/doc/quilt/README.source for instructions how to generate the
patched source, add a new modification, and remove an existing one.

7
debian/README.templates.d vendored Normal file
View File

@ -0,0 +1,7 @@
#
# As of Debian version 0.6.16-1, the default config.php adds all directories
# inside /etc/pnp4nagios/templates.d/ to the templates_dirs configuration.
# This allows third-party packages to provide their own set of PNP4Nagios
# templates and create a symlink to the template directory inside
# /etc/pnp4nagios/templates.d.
#

4
debian/TODO vendored Normal file
View File

@ -0,0 +1,4 @@
* Config split
- dependencies on -web
- apache
- testing testing testing

268
debian/changelog vendored Normal file
View File

@ -0,0 +1,268 @@
pnp4nagios (0.6.26-1) UNRELEASED; urgency=medium
* 0.6.26
-- Mario Fetka <mario.fetka@gmail.com> Fri, 20 Oct 2017 17:15:49 +0200
pnp4nagios (0.6.25-1) UNRELEASED; urgency=medium
* Bump to new upstream verison
-- Mario Fetka <mario.fetka@gmail.com> Sat, 20 May 2017 17:29:18 +0200
pnp4nagios (0.6.24+dfsg1-4~bpo80+1) jessie-backports; urgency=medium
* Backport to jessie-backports.
* Add myself to Uploaders.
-- Micah Anderson <micah@debian.org> Tue, 08 Dec 2015 13:39:31 -0500
pnp4nagios (0.6.24+dfsg1-4) unstable; urgency=medium
[ Peter Michael Green ]
* [d7b0b89] Fix FTBFS on arm64 due to outdated config.sub/guess
(Closes: #774047)
[ Markus Frosch ]
* [c672afa] Fix use of hardening flags with a patch
-- Markus Frosch <lazyfrosch@debian.org> Wed, 01 Jul 2015 20:07:30 +0200
pnp4nagios (0.6.24+dfsg1-3) unstable; urgency=medium
* [8021d79] Do JS minification with Python's jsmin (Closes: #769696)
-- Markus Frosch <lazyfrosch@debian.org> Sat, 27 Dec 2014 22:37:09 +0100
pnp4nagios (0.6.24+dfsg1-2) unstable; urgency=medium
* [36db791] Fix and clarify package descriptions
-- Markus Frosch <lazyfrosch@debian.org> Mon, 27 Oct 2014 14:30:17 +0100
pnp4nagios (0.6.24+dfsg1-1) unstable; urgency=medium
[ Sebastian Harl ]
* [48a705e9] Merged branch 'configsplit'.
* [bfcb36ca] README.Debian: Replaced c&p'ed Nagios with Icinga.
* [91a75610] README.Debian: Fixed typo (icingacfg → icinga.cfg).
* [9f1e4167] README.Debian: Improved typesetting a bit ;-)
* [a7f12f2d] README.Debian: Fixed typo (nagios → nagios3).
Also, made the document a bit more "DAU"-proof ;-)
* [009534c4] npcdmod.cfg: Fixed a few typos and improved wording.
[ Bernd Zeimetz ]
* [832a9632] Refreshing patches.
[ Markus Frosch ]
* [14693ff] Replace Sven Velt with Markus Frosch as secondary uploader
(Closes: #739098)
* [f2f01d4] Initial upstream branch
* [29d5377] Imported Upstream version 0.6.21
* [d4a4cdb] DFSG cleaned upstream version 0.6.21+dfsg1
(Closes: #737457) (Closes: #753457)
* [82701a7] Removed GBP config, we imported the tarball into GIT
* [45e91cc] Changes for the DFSG tarball, JQuery depends, links and cleanup
* [36ab52d] Switch to source format 3.0 (quilt)
* [fafe97f] Update watch file for DFSG versions
* [318fa21] Remove potential flattr code from documentation
* [913caf2] Control, Lintian and Standards Cleanup
* [28272e9] Add missing dependencies of config packages and fix arch
* [ce4e5ae] Modernize and split Apache configuration (Closes: #669839)
* [a79e4af] Prefer Icinga over Nagios3
* [cb1832a] Fill config packages
* [2a2c4f6] Modernize rules
* [0a244f8] Update copyright
* [311c9c5] Include default build flags
* [c37bcc4] Fix Apache configuration handling
* [a65f63a] Revert "DFSG cleaned upstream version 0.6.21+dfsg1"
* [b542e4a] Imported Upstream version 0.6.24
* [b920288] DFSG cleaned upstream version 0.6.24+dfsg1
* [b87ba16] Update patch privacy-warning for 0.6.24
* [eed3190] Add patch install_opts to avoid setting owners on dh_auto_install
* [46e24b7] Update README.Debian
* [7f49d88] Bump Standards version
-- Markus Frosch <lazyfrosch@debian.org> Sun, 26 Oct 2014 16:02:13 +0100
pnp4nagios (0.6.19-1) experimental; urgency=low
* New upstream release; thanks to Christoph Anton Mitterer for reporting
this (Closes: #682175).
* Uploading to experimental because of the Wheezy freeze.
* debian/pnp4nagios.postrm:
- Fixed typo: Apache's config files use file suffix .conf rather than
.cfg; this prevented /etc/apache2/conf.d/pnp4nagios.conf from being
removed on remove/purge; thanks to Andreas Beckmann for reporting this
(cf. #669839).
* debian/control:
- Optionally depend on php5-cgi instead of libapache2-mod-php5 to allow
for easier installations when not using Apache; thanks to Matthias
Wamser for reporting this (Closes: #671231).
- Updated standards-version to 3.9.4 -- no changes.
- Let pnp4nagios-bin suggest rrdtool which is used by the rrd_convert
helper script; thanks to Christoph Anton Mitterer for suggesting this
(cf. #684420).
* debian/patches:
- fix-npcd-path updated for 0.6.19.
- Added format-security; fixing a missing printf-style format argument.
* debian/rules:
- Manually clean-up auto-generated scripts/rrd_modify.pl.
- Use dpkg-buildflags to determine CPPFLAGS/CFLAGS.
* debian/icinga-module.cfg, debian/rules:
- Provide a sample Icinga module configuration; thanks to Christoph Anton
Mitterer for providing this (Closes: #683459).
* debian/nagios.cfg:
- Unified whitespacing; thanks to Christoph Anton Mitterer for the patch
(Closes: #683471).
* debian/pnp4nagios-bin.postinst:
- Don't use world-readable permissions for process_perfdata.cfg as this
would allow local users to read the Gearman shared key; thanks to
Christoph Anton Mitterer for reporting this; fixes CVE-2012-3457
(Closes: #683879).
-- Sebastian Harl <tokkee@debian.org> Thu, 24 Jan 2013 16:30:51 +0100
pnp4nagios (0.6.16-2) unstable; urgency=low
* debian/control:
- Adapted versioned build-dep on libjs-jquery-ui to the workaround used by
that package (1.8.14 -> 1.8.ooops.14). Thanks to Christoph Anton
Mitterer for reporting this (Closes: #683100).
* debian/patches/:
- adjust-template-path: Fixed the patch for empty templates.d and some
versions of glob() which in this case returns nothing resulting in PHP
syntax errors and a crash of PNP4Nagios; thanks to Christoph Anton
Mitterer for reporting this and pointing out a fix (Closes: #683138).
-- Sebastian Harl <tokkee@debian.org> Sat, 24 Nov 2012 15:34:54 +0100
pnp4nagios (0.6.16-1) unstable; urgency=low
* New upstream version.
* debian/control:
- Depend on jQuery >= 1.6.2 and jQuery-ui >= 1.8.14 (rather than
unversioned dependencies); this is what upstream did as well.
* debian/rules:
- Added recommended targets build-{arch,indep} depending on build-stamp.
* debian/pnp4nagios-bin.install:
- Install verify_pnp_config_v2.pl to /u/l/pnp4nagios/libexec/.
* debian/pnp4nagios-web.postinst:
- Call a2mod / restart apache2 only if the binaries are available; thanks
to Wouter Schoot for reporting this (Closes: #636218).
* debian/po/:
- Added Spanish debconf translations; thanks to Camaleón for providing
those (Closes: #632953).
- Added Portuguese debconf translations; thanks to Pedro Ribeiro for
providing those (Closes: #651432).
- Added Dutch debconf translations; thanks to Jeroen Schot for providing
those (Closes: #654214).
- Added Danish debconf translations; thanks to Joe Dalton for providing
those (Closes: #654816).
- Added Czech debconf translations; thanks to Michal Šimůnek for providing
those (Closes: #655132).
* debian/README.Debian:
- Added a note about installation with Icinga referring to the different
htpasswd.users file location; thanks to Alexander Reichle-Schmehl for
reporting this (Closes: #646587).
* debian/patches/adjust-template-path:
- Added support for /etc/pnp4nagios/templates.d.
* debian/README.templates.d:
- Added README file for the use of /etc/pnp4nagios/templates.d. The file
will be installed to that directory.
-- Sebastian Harl <tokkee@debian.org> Tue, 31 Jan 2012 14:00:47 +0100
pnp4nagios (0.6.13-1) unstable; urgency=low
* New upstream release.
* debian/README.Debian:
- Added more verbose instructions about how to setup mod_gearman mode.
* debian/patches/:
- Removed manpage-hyphen -- applied upstream.
* debian/rules:
- Don't remove scripts/rc.pnp_gearman_worker in 'clean' -- this is now
taken care of in the upstream Makefile.
* debian/po/:
- Added Japanese debconf translation; thanks to Hideki Yamane for
providing the translation (Closes: #626386).
- Added Swedish debconf translation; thanks to Martin Bagge for providing
the translation (Closes: #628926).
* debian/control:
- Updated standards-version to 3.9.2 -- no changes.
-- Sebastian Harl <tokkee@debian.org> Wed, 22 Jun 2011 12:42:18 +0200
pnp4nagios (0.6.12-1) unstable; urgency=low
* New upstream release.
* debian/patches/:
- Removed raise-process-perfdata-timeout -- a similar patch has been
included upstream.
- Added manpage-hyphen -- do not use hyphens as minus sign in npcd.8.
* debian/rules:
- npcd.cfg and process_perfdata.cfg are not longer installed as sample
configs by the upstream Makefile; so, don't rename those files.
- Do not pass --prefix to configure and set man-/infodir correctly. The
prefix is set by layout=debian and cannot be overwritten, thus do not
pretend this is possible. Also, do not use $prefix when setting man-/
infodir but specify the complete path.
- Do not install config_local.php and config.php.$PKG_VERSION.
- Remove generated scripts/rc.pnp_gearman_worker in 'clean'.
* debian/rules, debian/pnp4nagios-bin.install:
- Do not install npcd.8 using dh_installman; this is done by the upstream
Makefile now.
* debian/pnp4nagios-bin.pnp_gearman_worker.default,
pnp4nagios-bin.pnp_gearman_worker.init:
- Added init script for the PNP4Nagios Gearman worker daemon.
- The daemon is disabled by default.
-- Sebastian Harl <tokkee@debian.org> Wed, 27 Apr 2011 09:05:48 +0200
pnp4nagios (0.6.11-2) unstable; urgency=low
* debian/po/:
- Added French debconf translation; thanks to Christian Perrier for
providing the translation (Closes: #623181).
- Added German debconf translation.
- Added Russian debconf translation; thanks to Yuri Kozlov for providing
the translation (Closes: #623798).
* debian/pnp4nagios-web.postinst:
- Do not set permissions of /var/log/pnp4nagios/stats -- this is done in
pnp4nagios-bin.postinst which ships the directory. This fixes an error
when installing -web without -bin.
-- Sebastian Harl <tokkee@debian.org> Tue, 26 Apr 2011 11:48:54 +0200
pnp4nagios (0.6.11-1) unstable; urgency=low
[ Sven Velt ]
* Initial release (Closes: #479031)
* Use "php-fpdf", "php-fpdf-tpl" and "php-fpdi" packages instead of bundled
copies.
* Do not use the bundled copy of Kohana2 but rather depend on
libkohana2-php.
* Ship all configuration in /etc and create appropriate symlinks.
* Ship upstream sample configs as default configs.
* debian/patches:
- Added adjust-template-path: install templates into /etc/ rather than
/usr/share/.
- Added apache-fix-path-to-userfile: fix config directory in the sample
httpd.conf.
- Added fix-nagios-url: fix cgi-bin path in config.php.
- Added fix-npcd-path: fix perfdata paths in npcd.cfg.
- Added fix-path-fpdi: FPDI is shipped in its own subdirectory -- adopt
path in pdf.php.
- Added raise-process-perfdata-timeout: set timeout to 10s in
process_perfdata.cfg; in large and/or virtualized setups, 5s might not
be enough.
[ Sebastian Harl ]
* Build the following binary packages:
- pnp4nagios-bin: NPCD and process_perfdata.pl
- pnp4nagios-web: web interface
- pnp4nagios: metapackage depending on the other two
* debian/watch: mangle upstream version to replace ".rc" with "~rc".
* Make Apache2 configuration optional using debconf.
-- Sebastian Harl <tokkee@debian.org> Mon, 14 Feb 2011 13:15:46 +0100

15
debian/check_commands/check_nrpe.cfg vendored Normal file
View File

@ -0,0 +1,15 @@
#
# Adapt the Template if check_command should not be the PNP Template
#
# check_command check_nrpe!check_disk!20%!10%
# ________0__________| | | |
# ________1_____________________| | |
# ________2____________________________| |
# ________3_______________________________|
#
CUSTOM_TEMPLATE = 1
#
# Change the RRD Datatype based on the check_command Name.
# Defaults to GAUGE.
#
# DATATYPE = COUNTER

View File

@ -0,0 +1,15 @@
#
# Adapt the Template if check_command should not be the PNP Template
#
# check_command check_nrpe!check_disk!20%!10%
# ________0__________| | | |
# ________1_____________________| | |
# ________2____________________________| |
# ________3_______________________________|
#
CUSTOM_TEMPLATE = 1
#
# Change the RRD Datatype based on the check_command Name.
# Defaults to GAUGE.
#
# DATATYPE = COUNTER

2
debian/clean vendored Normal file
View File

@ -0,0 +1,2 @@
scripts/rrd_modify.pl
share/pnp/media/js/jquery.imgareaselect.min.js

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
8

114
debian/control vendored Normal file
View File

@ -0,0 +1,114 @@
Source: pnp4nagios
Section: net
Priority: optional
Maintainer: Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>
Uploaders:
Markus Frosch <lazyfrosch@debian.org>,
Micah Anderson <micah@debian.org>
Build-Depends:
autotools-dev,
debhelper (>= 8),
dh-autoreconf,
quilt,
rrdtool,
librrds-perl,
python
Standards-Version: 3.9.6
Homepage: http://www.pnp4nagios.org/
Vcs-Git: git://anonscm.debian.org/pkg-nagios/pkg-pnp4nagios.git
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-nagios/pkg-pnp4nagios.git
Package: pnp4nagios
Architecture: all
Depends:
${misc:Depends},
pnp4nagios-bin,
pnp4nagios-web,
Description: monitoring addon to create graphs from performance data
PNP is a graphing tool for Nagios, Icinga or similar frameworks that
analyzes performance data provided by plugins and stores them
automatically into Round Robin Databases (RRD).
.
It offers integration into the Nagios and Icinga Frontends.
.
PNP's goal is to be easily configurable and maintainable.
.
This is a metapackage depending on all parts of PNP4Nagios.
Package: pnp4nagios-bin
Architecture: any
Depends:
${misc:Depends},
${perl:Depends},
${shlibs:Depends},
librrds-perl,
adduser
Recommends: pnp4nagios-web, icinga | nagios4
Suggests: rrdtool, rrdcached, perl, libgearman-client-perl, libcrypt-rijndael-perl
Description: monitoring addon to create graphs from performance data - binaries
PNP is a graphing tool for Nagios, Icinga or similar frameworks that
analyzes performance data provided by plugins and stores them
automatically into Round Robin Databases (RRD).
.
It offers integration into the Nagios and Icinga Frontends.
.
PNP's goal is to be easily configurable and maintainable.
.
This package contains the NPCD-related binaries and process_perfdata.pl.
Package: pnp4nagios-web-config-icinga
Architecture: all
Depends: pnp4nagios-web (=${source:Version}), ${misc:Depends}
Recommends: apache2 | httpd
Suggests: icinga, icinga-cgi
Conflicts: pnp4nagios-web-config-nagios4
Replaces: pnp4nagios-web (<< 0.6.21)
Description: monitoring addon to create graphs from performance data - Icinga Classic config
PNP is a graphing tool for Nagios, Icinga or similar frameworks that
analyzes performance data provided by plugins and stores them
automatically into Round Robin Databases (RRD).
.
It offers integration into the Nagios and Icinga Frontends.
.
PNP's goal is to be easily configurable and maintainable.
.
This package contains the icinga-cgi configuration for pnp4nagios-web.
Package: pnp4nagios-web-config-nagios4
Architecture: all
Depends: pnp4nagios-web (=${source:Version}), ${misc:Depends}
Recommends: apache2 | httpd
Suggests: nagios4, nagios4-cgi
Conflicts: pnp4nagios-web-config-icinga
Replaces: pnp4nagios-web (<< 0.6.21)
Description: monitoring addon to create graphs from performance data - nagios4 CGI config
PNP is a graphing tool for Nagios, Icinga or similar frameworks that
analyzes performance data provided by plugins and stores them
automatically into Round Robin Databases (RRD).
.
It offers integration into the Nagios and Icinga Frontends.
.
PNP's goal is to be easily configurable and maintainable.
.
This package contains the nagios4-cgi configuration for pnp4nagios-web.
Package: pnp4nagios-web
Architecture: all
Depends:
${misc:Depends},
libapache2-mod-php5 | libapache2-mod-php7.0 | php5-cgi | php7.0-cgi | php7.0 | php5,
php7.0-gd | php5-gd ,
rrdtool,
adduser
Recommends: pnp4nagios-bin, pnp4nagios-web-config-icinga | pnp4nagios-web-config-nagios4
Suggests: rrdcached
Description: monitoring addon to create graphs from performance data - web interface
PNP is a graphing tool for Nagios, Icinga or similar frameworks that
analyzes performance data provided by plugins and stores them
automatically into Round Robin Databases (RRD).
.
It offers integration into the Nagios and Icinga Frontends.
.
PNP's goal is to be easily configurable and maintainable.
.
This package contains the web-interface for PNP4Nagios.

489
debian/copyright vendored Normal file
View File

@ -0,0 +1,489 @@
Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=166
Upstream-Name: PNP4Nagios
Upstream-Contact: Jörg Linge <pitchfork@pnp4nagios.org>
Source: http://docs.pnp4nagios.org/pnp-0.6/about#download
Files: *
Copyright:
2005-2014 Jörg Linge <pitchfork@pnp4nagios.org>
License: GPL-2+
Comment: See the file THANKS for a list of contributors.
Files:
scripts/verify_pnp_config.pl.in
Copyright:
2008-2010 Wolfgang Nieder
License: GPL-2+
Files: include/*
Copyright:
1999-2008 Ethan Galstad <nagios@nagios.org>
License: GPL-2
Files: include/npcdmod.h
Copyright:
2008 Hendrik Baecker
License: GPL-2
Files: lib/kohana/*
Copyright:
2007-2009 Kohana Team
License: BSD-3-clause
Comment: See <http://kohanaframework.org/team> for the list of team members.
Files:
lib/kohana/system/core/utf8.php
lib/kohana/system/core/utf8/*
Copyright:
2007, Kohana Team
2005, Harry Fuecks
License: LGPL-2.1
Files: lib/kohana/system/fonts/*
Copyright:
2003, Bitstream, Inc.
2006, Tavmjong Bah.
License: fonts-copyright
Files: lib/kohana/system/libraries/drivers/Database/Pdosqlite.php
Copyright:
Doutu
Greg MacLellan
License: BSD-3-clause
Files:
scripts/verify_pnp_config_v2.pl
scripts/rrd_modify.pl.in
Copyright:
2005-2012, PNP4Nagios Developer Team
License: GPL-2+
Files: share/pnp/templates.dist/check_apachestatus.php
Copyright:
Roman Ovchinnikov <coolthecold@gmail.com>
License: GPL-2+
Files: share/pnp/templates.dist/check_ntp_time.php
Copyright:
Mathias Kettner
License: GPL-2+
Files: share/pnp/templates.dist/check_esx3.php
Copyright:
2009 op5 AB (author: Mattias Ryrlen <dev@op5.com>)
Joerg Linge <joerg.linge@pnp4nagios.org>
License: GPL-2
Files: share/pnp/templates.dist/check_messpc_temp.php
Copyright:
Joerg Peter Geissler <lairdofglencairn@nagios-wiki.de>
License: GPL-2+
Files: check_mssql_health.php
Copyright:
2009-2011 Gerhard Lausser <gerhard.lausser@consol.de>
2011 Joerg Linge <support@pnp4nagios.org>
License: GPL-2+
Files: share/pnp/templates.dist/check_multi_nagiostats.php
Copyright:
2009 Matthias Flacke
License: GPL-2+
Files: share/pnp/templates.dist/check_mysql_health.php
Copyright:
2009 Gerhard Lausser <gerhard.lausser@consol.de>
License: GPL-2+
Files: share/pnp/templates.dist/check_openmanage.php
Copyright:
2008-2011 Trond Hasle Amundsen <t.h.amundsen@usit.uio.no>
License: GPL-3+
Files: share/pnp/application/lib/json.php
Copyright:
2005 Michal Migurski <mike-json@teczno.com>
Matt Knapp <mdknapp@gmail.com>
Brett Stimmerman <brettstimmerman@gmail.com>
License: BSD-2-clause
Files: share/pnp/application/vendor/fpdf/*
Copyright:
2008 Olivier Plathey <olivier@fpdf.org>
License: FPDF-license
Files:
share/pnp/application/vendor/fpdf/fpdf_tpl.php
share/pnp/application/vendor/fpdf/fpdi*
share/pnp/application/vendor/fpdf/pdf_context.php
share/pnp/application/vendor/fpdf/pdf_parser.php
share/pnp/application/vendor/fpdf/filters/*
Copyright:
2004-2009 Setasign - Jan Slabon
License: Apache-2.0
Files:
share/pnp/media/css/jquery.mobile.min.css
share/pnp/media/js/jquery.mobile.min.js
Copyright:
2010 jQuery Project
License: MIT and GPL-2+
Files:
share/pnp/media/js/jquery.imgareaselect.min.js
Copyright:
2008-2011 Michal Wojciechowski (odyniec.net)
License: MIT and GPL-2+
Files:
share/pnp/media/js/jquery-ui.min.js
share/pnp/media/css/ui-*
Copyright:
2010-2011 Brandon Aaron
2010-2011 Paul Bakaus (paulbakaus.com)
2010-2011 David Bolter
2010-2011 Rich Caloggero
2010-2011 Chi Cheng (cloudream@gmail.com)
2010-2011 Colin Clark (http://colin.atrc.utoronto.ca/)
2010-2011 Michelle D'Souza
2010-2011 Aaron Eisenberger (aaronchi@gmail.com)
2010-2011 Ariel Flesler
2010-2011 Bohdan Ganicky
2010-2011 Scott González
2010-2011 Marc Grabanski (m@marcgrabanski.com)
2010-2011 Klaus Hartl (stilbuero.de)
2010-2011 Scott Jehl
2010-2011 Cody Lindley
2010-2011 Eduardo Lundgren (eduardolundgren@gmail.com)
2010-2011 Todd Parker
2010-2011 John Resig
2010-2011 Patty Toland
2010-2011 Ca-Phun Ung (yelotofu.com)
2010-2011 Keith Wood (kbwood@virginbroadband.com.au)
2010-2011 Maggie Costello Wachs
2010-2011 Richard D. Worth (rdworth.org)
2010-2011 Jörn Zaefferer (bassistance.de)
License: MIT and GPL-2+
Files:
share/pnp/media/js/jquery-ui-timepicker-addon.js
Copyright:
2011 Trent Richardson
License: MIT and GPL-2+
Files: share/pnp/media/js/jquery.cluetip.js
Copyright:
2009 Karl Swedberg
License: MIT and GPL-2+
Comment: Copyright and license extracted from upstream website and sources.
Files: share/pnp/media/js/jquery-min.js
Copyright:
2010-2011 John Resig
2010-2011 The Dojo Foundation
License: MIT and BSD-3-clause and GPL-2+
Comment: License details extracted from upstream website.
Files: src/*
Copyright:
2006-2010 Hendrik Baecker <andurin@process-zero.de>
License: GPL-2
Files: src/utils.c
Copyright:
2006-2009 Hendrik Baecker <andurin@process-zero.de>
1999-2006 Ethan Galstad <nagios@nagios.org>
License: GPL-2
Files: debian/*
Copyright:
2009-2011, Sven Velt <sven@velt.de>
2011, Sebastian Harl <tokkee@debian.org>
2014, Markus Frosch <lazyfrosch@debian.org>
License: BSD-2-clause
Files:
debian/pnp4nagios-bin.npcd.init
Copyright:
2007 Javier Fernandez-Sanguino <jfs@debian.org>
2009 Sven Velt <sven@velt.de>
License: BSD-2-clause
Files:
debian/pnp4nagios-bin.pnp_gearman_worker.init
Copyright:
2007, Javier Fernandez-Sanguino <jfs@debian.org>
2011, Sebastian Harl <tokkee@debian.org>
License: BSD-2-clause
License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian systems, the full text of the Apache License, Version 2.0
can be found in the file `/usr/share/common-licenses/Apache-2.0'.
License: BSD-3-clause
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 Kohana nor the names of its 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.
License: BSD-2-clause
All rights reserved.
.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
.
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
.
2. 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.
.
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 HOLDERS 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.
License: LGPL-2.1
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.
On Debian systems, the full text of the GNU Lesser General Public
License version 2.1 can be found in the file
`/usr/share/common-licenses/LGPL-2.1'.
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
License: GPL-2
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
.
On Debian systems, the full text of the GNU General Public License version 2
can be found in the file `/usr/share/common-licenses/GPL-2'. The latest
version of the library can be found in the file
`/usr/share/common-licenses/GPL-2'.
License: GPL-2+
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
.
On Debian systems, the full text of the GNU General Public License version 2
can be found in the file `/usr/share/common-licenses/GPL-2'.
License: GPL-3+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
.
On Debian systems, the full text of the GNU General Public License version 3
can be found in the file `/usr/share/common-licenses/GPL-3'.
License: FPDF-license
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software to use, copy, modify, distribute, sublicense, and/or sell
copies of the software, and to permit persons to whom the software is
furnished to do so.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED.
License: fonts-copyright
Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below)
.
Bitstream Vera Fonts Copyright
------------------------------
.
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
a trademark of Bitstream, Inc.
.
Permission is hereby granted, free of charge, to any person obtaining a copy
of the fonts accompanying this license ("Fonts") and associated
documentation files (the "Font Software"), to reproduce and distribute the
Font Software, including without limitation the rights to use, copy, merge,
publish, distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to the
following conditions:
.
The above copyright and trademark notices and this permission notice shall
be included in all copies of one or more of the Font Software typefaces.
.
The Font Software may be modified, altered, or added to, and in particular
the designs of glyphs or characters in the Fonts may be modified and
additional glyphs or characters may be added to the Fonts, only if the fonts
are renamed to names not containing either the words "Bitstream" or the word
"Vera".
.
This License becomes null and void to the extent applicable to Fonts or Font
Software that has been modified and is distributed under the "Bitstream
Vera" names.
.
The Font Software may be sold as part of a larger software package but no
copy of one or more of the Font Software typefaces may be sold by itself.
.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
FONT SOFTWARE.
.
Except as contained in this notice, the names of Gnome, the Gnome
Foundation, and Bitstream Inc., shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this Font Software
without prior written authorization from the Gnome Foundation or Bitstream
Inc., respectively. For further information, contact: fonts at gnome dot
org.
.
Arev Fonts Copyright
------------------------------
.
Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.
.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the fonts accompanying this license ("Fonts") and
associated documentation files (the "Font Software"), to reproduce
and distribute the modifications to the Bitstream Vera Font Software,
including without limitation the rights to use, copy, merge, publish,
distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to
the following conditions:
.
The above copyright and trademark notices and this permission notice
shall be included in all copies of one or more of the Font Software
typefaces.
.
The Font Software may be modified, altered, or added to, and in
particular the designs of glyphs or characters in the Fonts may be
modified and additional glyphs or characters may be added to the
Fonts, only if the fonts are renamed to names not containing either
the words "Tavmjong Bah" or the word "Arev".
.
This License becomes null and void to the extent applicable to Fonts
or Font Software that has been modified and is distributed under the
"Tavmjong Bah Arev" names.
.
The Font Software may be sold as part of a larger software package but
no copy of one or more of the Font Software typefaces may be sold by
itself.
.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
.
Except as contained in this notice, the name of Tavmjong Bah shall not
be used in advertising or otherwise to promote the sale, use or other
dealings in this Font Software without prior written authorization
from Tavmjong Bah. For further information, contact: tavmjong @ free
. fr.

2
debian/docs vendored Normal file
View File

@ -0,0 +1,2 @@
AUTHORS
README.md

11
debian/icinga-module.cfg vendored Normal file
View File

@ -0,0 +1,11 @@
# This is a sample module definition for Icinga.
#
# Copy this file to /etc/icinga/modules/ in order to activate it.
define module {
module_name npcdmod
module_type neb
path /usr/lib/pnp4nagios/npcdmod.o
args config_file=/etc/pnp4nagios/npcd.cfg
}

2
debian/icinga/config.icinga.php vendored Normal file
View File

@ -0,0 +1,2 @@
<?php
$conf['nagios_base'] = "/cgi-bin/icinga";

15
debian/icinga/npcdmod.cfg vendored Normal file
View File

@ -0,0 +1,15 @@
# Icinga configuration for PNP4Nagios's npcdmod
#
# In order to enable the npcdmod event broker module in Icinga, you'll have to
# put a file similar to this one into /etc/icinga/modules/.
#
# ATTENTION: DO NOT load the same module here AND via broker_module in
# icinga.cfg. This can lead to problems with races on ressources.
#
define module{
module_name npcdmod
module_type neb
path /usr/lib/pnp4nagios/npcdmod.o
args config_file=/etc/pnp4nagios/npcd.cfg
}

24
debian/icinga/pnp4nagios.conf vendored Normal file
View File

@ -0,0 +1,24 @@
Alias /pnp4nagios "/usr/share/pnp4nagios/html"
<Directory "/usr/share/pnp4nagios/html">
AllowOverride None
AuthName "Icinga Access"
AuthType Basic
AuthUserFile /etc/icinga/htpasswd.users
Require valid-user
<IfModule mod_rewrite.c>
# Turn on URL rewriting
RewriteEngine On
Options symLinksIfOwnerMatch
# Installation directory
RewriteBase /pnp4nagios/
# Protect application and system files from being viewed
RewriteRule "^(?:application|modules|system)/" - [F]
# Allow any files or directories that exist to be displayed directly
RewriteCond "%{REQUEST_FILENAME}" !-f
RewriteCond "%{REQUEST_FILENAME}" !-d
# Rewrite all other URLs to index.php/URL
RewriteRule "^.*$" "index.php/$0" [PT]
</IfModule>
</Directory>

34
debian/nagios.cfg vendored Normal file
View File

@ -0,0 +1,34 @@
define command {
command_name pnp-synchronous-service
command_line /usr/bin/perl /usr/lib/pnp4nagios/libexec/process_perfdata.pl
}
define command {
command_name pnp-synchronous-host
command_line /usr/bin/perl /usr/lib/pnp4nagios/libexec/process_perfdata.pl -d HOSTPERFDATA
}
##############################################################################
define command {
command_name pnp-bulk-service
command_line /usr/bin/perl /usr/lib/pnp4nagios/libexec/process_perfdata.pl --bulk=/var/spool/pnp4nagios/nagios/service-perfdata
}
define command {
command_name pnp-bulk-host
command_line /usr/bin/perl /usr/lib/pnp4nagios/libexec/process_perfdata.pl --bulk=/var/spool/pnp4nagios/nagios/host-perfdata
}
##############################################################################
define command {
command_name pnp-bulknpcd-service
command_line /bin/mv /var/spool/pnp4nagios/nagios/service-perfdata /var/spool/pnp4nagios/npcd/service-perfdata.$TIMET$
}
define command {
command_name pnp-bulknpcd-host
command_line /bin/mv /var/spool/pnp4nagios/nagios/host-perfdata /var/spool/pnp4nagios/npcd/host-perfdata.$TIMET$
}

2
debian/nagios4/config.nagios4.php vendored Normal file
View File

@ -0,0 +1,2 @@
<?php
$conf['nagios_base'] = "/cgi-bin/nagios4";

24
debian/nagios4/pnp4nagios.conf vendored Normal file
View File

@ -0,0 +1,24 @@
Alias /pnp4nagios "/usr/share/pnp4nagios/html"
<Directory "/usr/share/pnp4nagios/html">
AllowOverride None
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios4/htpasswd.users
Require valid-user
<IfModule mod_rewrite.c>
# Turn on URL rewriting
RewriteEngine On
Options symLinksIfOwnerMatch
# Installation directory
RewriteBase /pnp4nagios/
# Protect application and system files from being viewed
RewriteRule "^(?:application|modules|system)/" - [F]
# Allow any files or directories that exist to be displayed directly
RewriteCond "%{REQUEST_FILENAME}" !-f
RewriteCond "%{REQUEST_FILENAME}" !-d
# Rewrite all other URLs to index.php/URL
RewriteRule "^.*$" "index.php/$0" [PT]
</IfModule>
</Directory>

29
debian/patches/adjust-template-path vendored Normal file
View File

@ -0,0 +1,29 @@
Description: Install templates into /etc/ rather than /usr/share/.
Also, add support for templates.d directory.
Author: Sven Velt <sven@velt.de>, Sebastian Harl <tokkee@debian.org
Forwarded: not-needed
--- a/sample-config/pnp/config.php.in
+++ b/sample-config/pnp/config.php.in
@@ -230,13 +230,19 @@ $conf['RRD_DAEMON_OPTS'] = '';
# Add your own template directories here
# First match wins!
#$conf['template_dirs'][] = '/usr/local/check_mk/pnp-templates';
-$conf['template_dirs'][] = '@datarootdir@/templates';
+$conf['template_dirs'][] = '@sysconfdir@/templates';
+$templates_d = glob("/etc/pnp4nagios/templates.d/*", GLOB_ONLYDIR);
+if (is_array($templates_d) && (count($templates_d) > 0)) {
+ foreach ($templates_d as $dirname) {
+ $conf['template_dirs'][] = "$dirname";
+ }
+}
$conf['template_dirs'][] = '@datarootdir@/templates.dist';
#
# Directory to search for special templates
#
-$conf['special_template_dir'] = '@datarootdir@/templates.special';
+$conf['special_template_dir'] = '@sysconfdir@/templates.special';
#
# Regex to detect mobile devices

View File

@ -0,0 +1,15 @@
Description: Fix config directory in the sample httpd.conf.
Author: Sven Velt <sven@velt.de>
Forwarded: not-needed
--- a/sample-config/httpd.conf.in
+++ b/sample-config/httpd.conf.in
@@ -11,7 +11,7 @@
#
AuthName "Nagios Access"
AuthType Basic
- AuthUserFile /usr/local/nagios/etc/htpasswd.users
+ AuthUserFile /etc/nagios4/htpasswd.users
Require valid-user
<IfModule mod_rewrite.c>
# Turn on URL rewriting

28
debian/patches/config_instances vendored Normal file
View File

@ -0,0 +1,28 @@
Description: Include a instance based config
Author: Markus Frosch <lazyfrosch@debian.org>
Last-Update: 2017-05-20
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/sample-config/pnp/config.php.in 2017-05-20 17:52:02.532000000 +0200
+++ b/sample-config/pnp/config.php.in 2017-05-20 17:48:33.008000000 +0200
@@ -89,7 +89,8 @@
#
# Link back to Nagios or Thruk ( www.thruk.org )
#
-$conf['nagios_base'] = "/cgi-bin/nagios4";
+## Debian: please see /etc/pnp4nagios/config.<NAME>.php
+##$conf['nagios_base'] = "/cgi-bin/nagios4";
#
# Link back to check_mk´s multisite ( http://mathias-kettner.de/checkmk_multisite.html )
@@ -278,4 +279,10 @@
'#F6E8C3','#C7EAE5','#DFC27D','#80CDC1','#BF812D','#35978F','#8C510A','#01665E');
$scheme['mixed3'] = array ('#67001F','#80CDC1','#B2182B','#35978F','#D6604D','#01665E','#F4A582','#003C30',
'#FDDBC7','#92C5DE','#D1E5F0','#2166AC','#4393C3','#8C510A','#053061','#BF812D');
+
+if (file_exists('/etc/pnp4nagios/config.icinga.php')) {
+ include '/etc/pnp4nagios/config.icinga.php';
+} else if (file_exists('/etc/pnp4nagios/config.nagios4.php')) {
+ include '/etc/pnp4nagios/config.nagios4.php';
+}
?>

15
debian/patches/fix-nagios-url vendored Normal file
View File

@ -0,0 +1,15 @@
Description: Fix cgi-bin path in config.php.
Author: Sven Velt <sven@velt.de>
Forwarded: not-needed
--- a/sample-config/pnp/config.php.in
+++ b/sample-config/pnp/config.php.in
@@ -89,7 +89,7 @@ $conf['temp'] = "/var/tmp";
#
# Link back to Nagios or Thruk ( www.thruk.org )
#
-$conf['nagios_base'] = "/nagios/cgi-bin";
+$conf['nagios_base'] = "/cgi-bin/nagios4";
#
# Link back to check_mk´s multisite ( http://mathias-kettner.de/checkmk_multisite.html )

24
debian/patches/fix-npcd-path vendored Normal file
View File

@ -0,0 +1,24 @@
Description: Fix perfdata paths in npcd.cfg.
Author: Sven Velt <sven@velt.de>
Forwarded: not-needed
--- a/sample-config/pnp/npcd.cfg-sample.in
+++ b/sample-config/pnp/npcd.cfg-sample.in
@@ -76,7 +76,7 @@
# perfdata_spool_dir = </path/to/directory/>
#
-perfdata_spool_dir = @PERFDATA_SPOOL_DIR@
+perfdata_spool_dir = @PERFDATA_SPOOL_DIR@/npcd/
# Execute following command for each found file
@@ -163,7 +163,7 @@
# perfdata_file = </path/to/file>
#
-perfdata_file = @localstatedir@/perfdata.dump
+perfdata_file = @PERFDATA_SPOOL_DIR@/nagios/perfdata.dump
# perfdata_spool_filename - declare the destination

26
debian/patches/hardening vendored Normal file
View File

@ -0,0 +1,26 @@
Description: Fix use of flags in Makefiles
To pass all hardening flags to gcc.
Author: Markus Frosch <lazyfrosch@debian.org>
Last-Update: 2015-07-01
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -83,7 +83,7 @@
#
###############################
npcd: npcd.c $(NPCDOBJS) $(NPCDHEAD)
- $(CC) $(CFLAGS) -o $@ npcd.c $(NPCDOBJS) -lpthread
+ $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ npcd.c $(NPCDOBJS) $(LDFLAGS) -lpthread
###############################
#
@@ -91,7 +91,7 @@
#
###############################
npcdmod.o: npcdmod.c
- $(CC) $(MOD_CFLAGS) $(CFLAGS) -o npcdmod.o npcdmod.c $(MOD_LDFLAGS) $(LDFLAGS) $(LIBS) -fPIC
+ $(CC) $(MOD_CFLAGS) $(CFLAGS) $(CPPFLAGS) -o npcdmod.o npcdmod.c $(MOD_LDFLAGS) $(LDFLAGS) $(LIBS) -fPIC
###############################
#

16
debian/patches/install_opts vendored Normal file
View File

@ -0,0 +1,16 @@
Description: Disable INSTALL_OPTS
Author: Markus Frosch <lazyfrosch@debian.org>
Last-Update: 2014-10-26
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/configure.ac
+++ b/configure.ac
@@ -116,7 +116,7 @@
AC_SUBST(nagios_grp)
AC_DEFINE_UNQUOTED(DEFAULT_NAGIOS_USER,"$nagios_user")
AC_DEFINE_UNQUOTED(DEFAULT_NAGIOS_GROUP,"$nagios_grp")
-INSTALL_OPTS="-o $nagios_user -g $nagios_grp"
+INSTALL_OPTS=""
AC_SUBST(INSTALL_OPTS)
# Checks for programs.

475
debian/patches/pnp-metrics-api vendored Normal file
View File

@ -0,0 +1,475 @@
diff -uNr pnp4nagios.orig/README pnp4nagios-0.6.26/README
--- pnp4nagios.orig/README 2017-08-21 17:52:37.000000000 +0200
+++ pnp4nagios-0.6.26/README 2017-10-20 17:29:21.680000000 +0200
@@ -8,3 +8,8 @@
http://pnp4nagios.sourceforge.net or:
http://docs.pnp4nagios.org/
+
+## pnp-metrics-api ###
+
+https://github.com/lingej/pnp-metrics-api
+README.md
diff -uNr pnp4nagios.orig/README.md pnp4nagios-0.6.26/README.md
--- pnp4nagios.orig/README.md 1970-01-01 01:00:00.000000000 +0100
+++ pnp4nagios-0.6.26/README.md 2017-10-20 17:02:31.336000000 +0200
@@ -0,0 +1,56 @@
+# pnp-metrics-api
+## Usage examples
+### CURL
+#### Query metrics of a service on a specific host
+```
+curl -s -u '<username>:<password>' -H "Content-Type: application/json" -X POST -d '
+{
+ "targets":[
+ {
+ "host":"host1.example.org",
+ "service":"_HOST_",
+ "perflabel":"rta",
+ "type":"AVERAGE"
+ },
+ {
+ "host":"host2.example.org",
+ "service":"_HOST_",
+ "perflabel":"rta",
+ "type":"AVERAGE"
+ }
+ ],
+ "start":'UNIXEPOCHTIMESTAMP_START',
+ "end":'UNIXEPOCHTIMESTAMP_END'
+}' https://example.org/pnp4nagios/index.php/api/metrics
+```
+#### List all hosts
+```
+curl -s -u '<username>:<password>' https://example.org/pnp4nagios/index.php/api/hosts
+```
+
+#### List services of a host
+```
+curl -s -u '<username>:<password>' -H "Content-Type: application/json" -X POST -d '
+{
+ "host":"host.example.org"
+}' https://example.org/pnp4nagios/index.php/api/services
+```
+
+You can use regular expressions for host lists:
+
+```
+curl -s -u '<username>:<password>' -H "Content-Type: application/json" -X POST -d '
+{
+ "host":"/^local"
+}' https://example.org/pnp4nagios/index.php/api/services
+```
+
+
+#### List labels of a service of specific host
+```
+curl -s -u '<username>:<password>' -H "Content-Type: application/json" -X POST -d '
+{
+ "host":"host.example.org",
+ "service":"_HOST_"
+}' https://example.org/pnp4nagios/index.php/api/labels
+```
diff -uNr pnp4nagios.orig/share/pnp/application/controllers/api.php pnp4nagios-0.6.26/share/pnp/application/controllers/api.php
--- pnp4nagios.orig/share/pnp/application/controllers/api.php 1970-01-01 01:00:00.000000000 +0100
+++ pnp4nagios-0.6.26/share/pnp/application/controllers/api.php 2017-10-20 17:29:56.444000000 +0200
@@ -0,0 +1,399 @@
+<?php defined('SYSPATH') OR die('No direct access allowed.');
+/**
+* API controller.
+*
+* @package pnp4nagios
+* @author Joerg Linge
+* @license GPL
+*/
+class Api_Controller extends System_Controller {
+
+ public function __construct(){
+ parent::__construct();
+ // Disable auto-rendering
+ $this->auto_render = FALSE;
+ $this->data->getTimeRange($this->start,$this->end,$this->view);
+ // Graphana sends JSON via POST
+ $this->post_data = json_decode(file_get_contents('php://input'), true);
+
+ }
+
+ public function index() {
+ $data['pnp_version'] = PNP_VERSION;
+ $data['pnp_rel_date'] = PNP_REL_DATE;
+ $data['error'] = "";
+ return_json($data, 200);
+ }
+
+ /*
+ *
+ *
+ */
+ public function hosts($query = false) {
+ $data = array();
+ $hosts = getHosts($this->data, $query);
+ foreach ( $hosts as $host ){
+ $data['hosts'][] = array(
+ 'name' => $host
+ );
+ }
+ return_json($data, 200);
+ }
+
+ /*
+ *
+ *
+ */
+ public function services() {
+ $data = array();
+ if ($_SERVER['REQUEST_METHOD'] != 'POST') {
+ // Only Post Reuests
+ $data['error'] = "Only POST Requests allowed";
+ return_json($data, 901);
+ return;
+ }
+ $pdata = json_decode(file_get_contents('php://input'), TRUE);
+
+ $host = arr_get($pdata, "host");
+ if ( $host === false ){
+ $data['error'] = "No hostname specified";
+ return_json($data, 901);
+ return;
+ }
+ $services = array();
+ $hosts = getHosts($this->data, $host);
+ $services = getServices($this->data, $hosts);
+ $duplicates = array();
+
+ foreach($services as $service){
+ // skip duplicates
+ if(isset($duplicates[$service['servicedesc']])) {
+ continue;
+ }
+ $duplicates[$service['servicedesc']] = true;
+ $data['services'][] = array(
+ 'name' => $service['name'],
+ 'servicedesc' => $service['servicedesc'],
+ 'hostname' => $service['hostname']
+ );
+ }
+ return_json($data, 200);
+ }
+
+ /*
+ *
+ *
+ */
+ public function labels ( $host=false, $service=false ) {
+ $data = array();
+ if ($_SERVER['REQUEST_METHOD'] != 'POST') {
+ // Only Post Reuests
+ $data['error'] = "Only POST Requests allowed";
+ return_json($data, 901);
+ return;
+ }
+ $pdata = json_decode(file_get_contents('php://input'), TRUE);
+ $host = arr_get($pdata, "host");
+ $service = arr_get($pdata, "service");
+
+ if ( $host === false ){
+ $data['error'] = "No hostname specified";
+ return_json($data, 901);
+ return;
+ }
+ if ( $service === false ){
+ $data['error'] = "No service specified";
+ return_json($data, 901);
+ return;
+ }
+
+ $hosts = getHosts($this->data, $host);
+ $services = getServices($this->data, $hosts, $service);
+ $duplicates = array();
+
+ foreach($services as $service){
+ try {
+ // read XML file
+ $this->data->readXML($service['hostname'], $service['name']);
+ } catch (Kohana_Exception $e) {
+ $data['error'] = "$e";
+ return_json($data, 901);
+ return;
+ }
+
+ foreach( $this->data->DS as $KEY => $DS) {
+ // skip duplicates
+ if(isset($duplicates[$DS['LABEL']])) {
+ continue;
+ }
+ $duplicates[$DS['LABEL']] = true;
+ $data['labels'][] = array(
+ 'name' => $DS['NAME'],
+ 'label' => $DS['LABEL'],
+ 'service' => $service['name'],
+ 'hostname' => $service['hostname']
+ );
+ }
+ }
+ return_json($data, 200);
+ }
+
+
+ public function metrics(){
+ // extract metrics for a given datasource
+ // TODO Multiple sources via regex
+ if ($_SERVER['REQUEST_METHOD'] != 'POST') {
+ // Only Post Reuests
+ $data['error'] = "Only POST Requests allowed";
+ return_json($data, 901);
+ return;
+ }
+ $hosts = array(); // List of all Hosts
+ $services = array(); // List of services for a given host
+ $pdata = json_decode(file_get_contents('php://input'), TRUE);
+ $data = array();
+
+ if ( !isset($pdata['targets']) ){
+ $data['error'] = "No targets specified";
+ return_json($data, 901);
+ return;
+ }
+
+ foreach( $pdata['targets'] as $key => $target){
+
+ $this->data->TIMERANGE['start'] = arr_get($pdata, 'start');
+ $this->data->TIMERANGE['end'] = arr_get($pdata, 'end');
+ $host = arr_get($target, 'host');
+ $service = arr_get($target, 'service');
+ $perflabel = arr_get($target, 'perflabel');
+ $type = arr_get($target, 'type');
+ $refid = arr_get($target, 'refid');
+ if ( $host === false ){
+ $data['error'] = "No hostname specified";
+ return_json($data, 901);
+ return;
+ }
+ if ( $service === false ){
+ $data['error'] = "No service specified";
+ return_json($data, 901);
+ return;
+ }
+ if ( $perflabel === false ){
+ $data['error'] = "No perfdata label specified";
+ return_json($data, 901);
+ return;
+ }
+ if ( $type === false ){
+ $data['error'] = "No perfdata type specified";
+ return_json($data, 901);
+ return;
+ }
+ $hosts = getHosts($this->data, $host);
+ $services = getServices($this->data, $hosts, $service);
+
+ $hk = 0; // Host Key
+
+ foreach ( $services as $service) {
+ $host = $service['hostname'];
+ $service = $service['name'];
+ try {
+ // read XML file
+ $this->data->readXML($host, $service);
+ } catch (Kohana_Exception $e) {
+ $data['error'] = "$e";
+ return_json($data, 901);
+ return;
+ }
+
+ // create a Perflabel List
+ $perflabels = array();
+ foreach( $this->data->DS as $value){
+ $label = arr_get($value, "LABEL" );
+ if (isRegex($perflabel)) {
+ if(!preg_match( $perflabel, $label ) ){
+ continue;
+ }
+ } elseif ( $perflabel != $label ) {
+ continue;
+ }
+ $perflabels[] = array(
+ "label" => arr_get($value, "NAME" ),
+ "warn" => arr_get($value, "WARN" ),
+ "crit" => arr_get($value, "CRIT" )
+ );
+ }
+
+ foreach ( $perflabels as $tmp_perflabel){
+ try {
+ $this->data->buildXport($host, $service);
+ $xml = $this->rrdtool->doXport($this->data->XPORT);
+ } catch (Kohana_Exception $e) {
+ $data['error'] = "$e";
+ return_json($data, 901);
+ return;
+ }
+
+ $xpd = simplexml_load_string($xml);
+ $i = 0;
+ $index = -1;
+ foreach ( $xpd->meta->legend->entry as $k=>$v){
+ if($type == "WARNING" || $type == "CRITICAL") {
+ if( $v == $tmp_perflabel['label']."_AVERAGE"){
+ $index = $i;
+ break;
+ }
+ }
+ else {
+ if( $v == $tmp_perflabel['label']."_".$type){
+ $index = $i;
+ break;
+ }
+ }
+ $i++;
+ }
+ if ( $index === -1 ){
+ $data['error'] = "No perfdata found for ".$tmp_perflabel['label']."_".$type;
+ return_json($data, 901);
+ return;
+ }
+
+ $start = (string) $xpd->meta->start;
+ $end = (string) $xpd->meta->end;
+ $step = (string) $xpd->meta->step;
+ $data['targets'][$key][$hk]['start'] = $start * 1000;
+ $data['targets'][$key][$hk]['end'] = $end * 1000;
+ $data['targets'][$key][$hk]['host'] = $host;
+ $data['targets'][$key][$hk]['service'] = $service;
+ $data['targets'][$key][$hk]['perflabel'] = $tmp_perflabel['label'];
+ $data['targets'][$key][$hk]['type'] = $type;
+
+ $i = 0;
+ if($type == "WARNING" || $type == "CRITICAL") {
+ foreach ( $xpd->data->row as $row=>$value){
+ // timestamp in milliseconds
+ $timestamp = ( $start + $i * $step ) * 1000;
+ if($type == "WARNING") {
+ $d = floatval($tmp_perflabel['warn']);
+ } else {
+ $d = floatval($tmp_perflabel['crit']);
+ }
+ $data['targets'][$key][$hk]['datapoints'][] = array( $d, $timestamp );
+ $i++;
+ }
+ } else {
+ foreach ( $xpd->data->row as $row=>$value){
+ // timestamp in milliseconds
+ $timestamp = ( $start + $i * $step ) * 1000;
+ $d = (string) $value->v->$index;
+ if ($d == "NaN"){
+ $d = null;
+ }else{
+ $d = floatval($d);
+ }
+ $data['targets'][$key][$hk]['datapoints'][] = array( $d, $timestamp );
+ $i++;
+ }
+ }
+
+ $hk++;
+
+ }
+ }
+ }
+
+ return_json($data, 200);
+ }
+}
+/*
+* return array key
+*/
+function arr_get($array, $key=false, $default=false){
+ if ( isset($array) && $key == false ){
+ return $array;
+ }
+ $keys = explode(".", $key);
+ foreach ($keys as $key_part) {
+ if ( isset($array[$key_part] ) === false ) {
+ if (! is_array($array) or ! array_key_exists($key_part, $array)) {
+ return $default;
+ }
+ }
+ $array = $array[$key_part];
+ }
+ return $array;
+}
+
+/*
+*
+*/
+function return_json( $data, $status=200 ){
+ $json = json_encode($data);
+ header('Status: '.$status);
+ header('Content-type: application/json');
+ print $json;
+}
+
+function isRegex($string){
+ // if string looks like an regex /regex/
+ if ( substr($string,0,1) == "/" && substr($string,-1,1) == "/" && strlen($string) >= 2 ){
+ return true;
+ }else{
+ return false;
+ }
+}
+
+function getHosts($data, $query = false) {
+ $result = array();
+ $hosts = $data->getHosts();
+ $isRegex = false;
+ if ($query !== false && isRegex($query) ) {
+ $isRegex = true;
+ }
+ foreach ( $hosts as $host ){
+ if ( $host['state'] != 'active' ){
+ continue;
+ }
+ if($isRegex) {
+ if(preg_match("$query", $host['name']) ) {
+ $result[] = $host['name'];
+ }
+ }
+ elseif ($query !== false) {
+ if("$query" == $host['name']) {
+ $result[] = $host['name'];
+ }
+ } else {
+ $result[] = $host['name'];
+ }
+ }
+ return($result);
+}
+
+/*
+* returns list of service hashes
+*/
+function getServices($data, $hosts, $query = false) {
+ $result = array();
+ $isRegex = false;
+ if ($query !== false && isRegex($query) ) {
+ $isRegex = true;
+ }
+ foreach ( $hosts as $host){
+ $services = $data->getServices($host);
+ foreach ($services as $value) {
+ if ($isRegex) {
+ if ( preg_match("$query", $value['name']) || preg_match("$query", $value['servicedesc'])) {
+ $result[] = $value;
+ }
+ }
+ elseif ($query !== false) {
+ if("$query" == $value['name'] || "$query" == $value['servicedesc']) {
+ $result[] = $value;
+ }
+ } else {
+ $result[] = $value;
+ }
+ }
+ }
+ return($result);
+}

8
debian/patches/series vendored Normal file
View File

@ -0,0 +1,8 @@
apache-fix-path-to-userfile
fix-npcd-path
fix-nagios-url
adjust-template-path
config_instances
install_opts
hardening
pnp-metrics-api

1
debian/pnp4nagios-bin.examples vendored Normal file
View File

@ -0,0 +1 @@
debian/icinga/npcdmod.cfg

13
debian/pnp4nagios-bin.install vendored Normal file
View File

@ -0,0 +1,13 @@
etc/pnp4nagios/nagios.cfg
etc/pnp4nagios/check_commands/
etc/pnp4nagios/*.cfg
usr/lib/pnp4nagios/libexec/
usr/lib/pnp4nagios/npcdmod.o
../../scripts/verify_pnp_config_v2.pl /usr/lib/pnp4nagios/libexec/
usr/sbin/npcd
usr/share/doc/pnp4nagios/examples/*.cfg
usr/share/doc/pnp4nagios/examples/check_commands/
usr/share/man/man8/npcd.8
var/log/pnp4nagios/stats/
var/lib/pnp4nagios/perfdata/
var/spool/pnp4nagios/

7
debian/pnp4nagios-bin.npcd.default vendored Normal file
View File

@ -0,0 +1,7 @@
# Default settings for the NPCD init script.
# Should NPCD be started? ("yes" to enable)
RUN="no"
# Additional options that are passed to the daemon.
DAEMON_OPTS="-d -f /etc/pnp4nagios/npcd.cfg"

204
debian/pnp4nagios-bin.npcd.init vendored Normal file
View File

@ -0,0 +1,204 @@
#!/bin/sh
#
# init.d script for NPCD of PNP4Nagios
#
# Based on a example script of Javier Fernandez-Sanguino
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
# Copyright (c) 2009 Sven Velt <sven@velt.de>
#
### BEGIN INIT INFO
# Provides: npcd
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Nagios Performance C Daemon
# Description: Speed up processing of Nagios' performance data
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/npcd
NAME=npcd
DESC="Nagios Performance C Daemon (PNP4Nagios)"
LOGDIR=/var/log/pnp4nagios
PIDFILE=/var/run/$NAME.pid
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
# Default options, these can be overriden by the information
# at /etc/default/$NAME
DAEMON_OPTS=""
DIETIME=10
STARTTIME=2
LOGFILE=$LOGDIR/$NAME.log
# Include defaults if available
if [ -f /etc/default/npcd ] ; then
. /etc/default/npcd
fi
# Check if RUN is set to "yes" in /etc/defaults/npcd
if [ "x$RUN" != "xyes" ] ; then
echo "$NAME has been disabled in /etc/default/npcd."
exit 0
fi
set -e
# Check if a given process pid's cmdline matches a given name
running_pid() {
pid=$1
name=$2
[ -z "$pid" ] && return 1
[ ! -d /proc/$pid ] && return 1
cmd=`cat /proc/$pid/cmdline | tr "\000" "\n" | head -n 1 | cut -d : -f 1`
# Is this the expected server
[ "$cmd" != "$name" ] && return 1
return 0
}
# Check if the process is running looking at /proc
# (works for all users)
running() {
# No pidfile, probably no daemon present
[ ! -f "$PIDFILE" ] && return 1
pid=`cat $PIDFILE`
running_pid $pid $DAEMON || return 1
return 0
}
# Start the process using the wrapper
start_server() {
start_daemon -p $PIDFILE $DAEMON $DAEMON_OPTS
errcode=$?
return $errcode
}
# Stop the process using the wrapper
stop_server() {
killproc -p $PIDFILE $DAEMON
errcode=$?
return $errcode
}
reload_server() {
[ ! -f "$PIDFILE" ] && return 1
pid=pidofproc $PIDFILE # This is the daemon's pid
# Send a SIGHUP
kill -1 $pid
return $?
}
# Force the process to die killing it manually
force_stop() {
[ ! -e "$PIDFILE" ] && return
if running ; then
kill -15 $pid
# Is it really dead?
sleep "$DIETIME"s
if running ; then
kill -9 $pid
sleep "$DIETIME"s
if running ; then
echo "Cannot kill $NAME (pid=$pid)!"
exit 1
fi
fi
fi
rm -f $PIDFILE
}
case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
# Check if it's running first
if running ; then
log_progress_msg "apparently already running"
log_end_msg 0
exit 0
fi
if start_server ; then
# NOTE: Some servers might die some time after they start,
# this code will detect this issue if STARTTIME is set
# to a reasonable value
[ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time
if running ; then
# It's ok, the server started and is running
log_end_msg 0
else
# It is not running after we did start
log_end_msg 1
fi
else
# Either we could not start it
log_end_msg 1
fi
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
if running ; then
# Only stop the server if we see it running
errcode=0
stop_server || errcode=$?
log_end_msg $errcode
else
# If it's not running don't do anything
log_progress_msg "apparently not running"
log_end_msg 0
exit 0
fi
;;
force-stop)
# First try to stop gracefully the program
$0 stop
if running; then
# If it's still running try to kill it more forcefully
log_daemon_msg "Stopping (force) $DESC" "$NAME"
errcode=0
force_stop || errcode=$?
log_end_msg $errcode
fi
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
errcode=0
stop_server || errcode=$?
# Wait some sensible amount, some server need this
[ -n "$DIETIME" ] && sleep $DIETIME
start_server || errcode=$?
[ -n "$STARTTIME" ] && sleep $STARTTIME
running || errcode=$?
log_end_msg $errcode
;;
status)
log_daemon_msg "Checking status of $DESC" "$NAME"
if running ; then
log_progress_msg "running"
log_end_msg 0
else
log_progress_msg "apparently not running"
log_end_msg 1
exit 1
fi
;;
# Use this if the daemon cannot reload
reload)
log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon"
log_warning_msg "cannot re-read the config file (use restart)."
exit 1
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,11 @@
# Default settings for the pnp_gearman_worker init script.
# Should the gearman worker daemon be started? ("yes" to enable)
RUN="no"
# Additional options that are passed to the daemon.
DAEMON_OPTS="--config=/etc/pnp4nagios/process_perfdata.cfg"
# Change to this user before starting the daemon.
# Note: the daemon refuses to start as root.
USER=nagios

View File

@ -0,0 +1,210 @@
#!/bin/sh
#
# init.d script for the Gearman worker daemon of PNP4Nagios
#
# Based on an example script for NPCD of Javier Fernandez-Sanguino
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
# Copyright (c) 2011 Sebastian Harl <tokkee@debian.org>
#
### BEGIN INIT INFO
# Provides: pnp_gearman_worker
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: PNP4Nagios Gearman worker daemon
# Description: Processing of Nagios' perf data in distributed setups
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/lib/pnp4nagios/libexec/process_perfdata.pl
NAME=pnp_gearman_worker
DESC="PNP4Nagios Gearman worker daemon"
PIDFILE=/var/run/pnp4nagios/$NAME.pid
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
# Default options, these can be overriden by the information
# at /etc/default/$NAME
DAEMON_OPTS=""
DIETIME=10
STARTTIME=2
USER=nagios
if [ -f /etc/default/pnp_gearman_worker ] ; then
. /etc/default/pnp_gearman_worker
fi
if [ "x$RUN" != "xyes" ] ; then
echo "$NAME has been disabled in /etc/default/pnp_gearman_worker."
exit 0
fi
set -e
# Check if a given process pid's cmdline matches a given name
running_pid() {
pid=$1
name=$2
[ -z "$pid" ] && return 1
[ ! -d /proc/$pid ] && return 1
cmd=`cat /proc/$pid/cmdline | tr "\000" "\n" | head -n 1 | cut -d : -f 1`
# Is this the expected server
[ "$cmd" != "$name" ] && return 1
return 0
}
# Check if the process is running looking at /proc
# (works for all users)
running() {
# No pidfile, probably no daemon present
[ ! -f "$PIDFILE" ] && return 1
pid=`cat $PIDFILE`
running_pid "$pid" $DAEMON \
|| running_pid "$pid" "/usr/bin/perl" || return 1
return 0
}
# Start the process using the wrapper
start_server() {
if ! perl -MGearman::Worker -e '1;' > /dev/null 2>&1 \
|| ! perl -MMIME::Base64 -e '1;' > /dev/null 2>&1 \
|| ! perl -MCrypt::Rijndael -e '1;' > /dev/null 2>&1; then
echo "$NAME requires the Gearman::Worker, MIME::Base64 and" >&2
echo "Crypt::Rijndael Perl modules. Make sure that the packages" >&2
echo "perl, libgearman-client-perl and libcrypt-rijndael-perl" >&2
echo "are installed." >&2
exit 1
fi
if [ -d /var/run/pnp4nagios ]; then
chmod 755 /var/run/pnp4nagios
chown nagios.nagios /var/run/pnp4nagios
else
install -d -m 755 -o nagios -g nagios /var/run/pnp4nagios
fi
start_opts="--start --quiet --oknodo --pidfile $PIDFILE"
if [ -n "$USER" ]; then
start_opts="$start_opts --chuid $USER"
fi
start-stop-daemon $start_opts --exec $DAEMON -- \
--pidfile=$PIDFILE --gearman --daemon $DAEMON_OPTS
errcode=$?
return $errcode
}
# Stop the process using the wrapper
stop_server() {
killproc -p $PIDFILE $DAEMON
errcode=$?
return $errcode
}
# Force the process to die killing it manually
force_stop() {
[ ! -e "$PIDFILE" ] && return
if running ; then
kill -15 $pid
# Is it really dead?
sleep "$DIETIME"s
if running ; then
kill -9 $pid
sleep "$DIETIME"s
if running ; then
echo "Cannot kill $NAME (pid=$pid)!"
exit 1
fi
fi
fi
rm -f $PIDFILE
}
case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
# Check if it's running first
if running ; then
log_progress_msg "apparently already running"
log_end_msg 0
exit 0
fi
if start_server ; then
# NOTE: Some servers might die some time after they start,
# this code will detect this issue if STARTTIME is set
# to a reasonable value
[ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time
if running ; then
# It's ok, the server started and is running
log_end_msg 0
else
# It is not running after we did start
log_end_msg 1
fi
else
# Either we could not start it
log_end_msg 1
fi
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
if running ; then
# Only stop the server if we see it running
errcode=0
stop_server || errcode=$?
log_end_msg $errcode
else
# If it's not running don't do anything
log_progress_msg "apparently not running"
log_end_msg 0
exit 0
fi
;;
force-stop)
# First try to stop gracefully the program
$0 stop
if running; then
# If it's still running try to kill it more forcefully
log_daemon_msg "Stopping (force) $DESC" "$NAME"
errcode=0
force_stop || errcode=$?
log_end_msg $errcode
fi
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
errcode=0
stop_server || errcode=$?
# Wait some sensible amount, some server need this
[ -n "$DIETIME" ] && sleep $DIETIME
start_server || errcode=$?
[ -n "$STARTTIME" ] && sleep $STARTTIME
running || errcode=$?
log_end_msg $errcode
;;
status)
log_daemon_msg "Checking status of $DESC" "$NAME"
if running ; then
log_progress_msg "running"
log_end_msg 0
else
log_progress_msg "apparently not running"
log_end_msg 1
exit 1
fi
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0

78
debian/pnp4nagios-bin.postinst vendored Normal file
View File

@ -0,0 +1,78 @@
#!/bin/sh
# postinst script for pnp4nagios-bin
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
setperm() {
user="$1"
group="$2"
mode="$3"
file="$4"
shift 4
# only do something when no setting exists
if ! dpkg-statoverride --list "$file" >/dev/null 2>&1; then
chown "$user":"$group" "$file"
chmod "$mode" "$file"
fi
}
case "$1" in
configure)
if ! getent passwd nagios > /dev/null ; then
echo 'Adding system-user for nagios' 1>&2
adduser --system --group --home /var/lib/nagios \
--disabled-login --force-badname nagios > /dev/null
fi
setperm nagios www-data 750 /var/lib/pnp4nagios
setperm nagios nagios 755 /var/lib/pnp4nagios/perfdata
setperm nagios www-data 750 /var/log/pnp4nagios
setperm nagios nagios 750 /var/log/pnp4nagios/stats
setperm nagios nagios 770 /var/spool/pnp4nagios
setperm nagios nagios 770 /var/spool/pnp4nagios/nagios
setperm nagios nagios 770 /var/spool/pnp4nagios/npcd
setperm root nagios 640 /etc/pnp4nagios/process_perfdata.cfg
if [ -d /etc/nagios4/conf.d/ ]; then
if [ ! -e /etc/nagios4/conf.d/pnp4nagios.cfg ]; then
ln -s /etc/pnp4nagios/nagios.cfg /etc/nagios4/conf.d/pnp4nagios.cfg
fi
fi
if [ -d /etc/icinga/objects/ ]; then
if [ ! -e /etc/icinga/objects/pnp4nagios.cfg ]; then
ln -s /etc/pnp4nagios/nagios.cfg /etc/icinga/objects/pnp4nagios.cfg
fi
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

57
debian/pnp4nagios-bin.postrm vendored Normal file
View File

@ -0,0 +1,57 @@
#!/bin/sh
# postrm script for pnp4nagios-bin
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <overwriter>
# <overwriter-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
purge|remove)
if [ -d /etc/nagios4/conf.d/ ]; then
if [ -L /etc/nagios4/conf.d/pnp4nagios.cfg ]; then
ls -l /etc/nagios4/conf.d/pnp4nagios.cfg | grep -q /etc/pnp4nagios/nagios.cfg
if [ $? -eq 0 ]; then
rm -f /etc/nagios4/conf.d/pnp4nagios.cfg
fi
fi
fi
if [ -d /etc/icinga/objects/ ]; then
if [ -L /etc/icinga/objects/pnp4nagios.cfg ]; then
ls -l /etc/icinga/objects/pnp4nagios.cfg | grep -q /etc/pnp4nagios/nagios.cfg
if [ $? -eq 0 ]; then
rm -f /etc/icinga/objects/pnp4nagios.cfg
fi
fi
fi
;;
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

View File

@ -0,0 +1,2 @@
debian/icinga/config.icinga.php etc/pnp4nagios
debian/icinga/pnp4nagios.conf etc/apache2/conf-available

View File

@ -0,0 +1,7 @@
# ignoring apache2 warning
# this is actually not a problem, because the handling is backwards compatible
apache2-reverse-dependency-calls-invoke-rc.d postrm
apache2-reverse-dependency-calls-wrapper-script postinst a2enmod
apache2-reverse-dependency-calls-invoke-rc.d postinst
# we actually want that
non-standard-apache2-configuration-name pnp4nagios.conf != pnp4nagios-web-config-icinga.conf

View File

@ -0,0 +1,63 @@
#!/bin/sh
# postinst script for pnp4nagios-web-config-icinga
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
echo "enabling Apache2 config..."
COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true)
# NEW method for Apache >= 2.4
if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
. /usr/share/apache2/apache2-maintscript-helper
apache2_invoke enmod rewrite
apache2_invoke enconf pnp4nagios
# remove OLD Apache 2.2 link
[ -L /etc/apache2/conf.d/pnp4nagios-web.conf ] && rm /etc/apache2/conf.d/pnp4nagios-web.conf
# OLD methods for Apache < 2.4
elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
# enable mod rewrite
[ -f /etc/apache2/mods-enabled/rewrite.load ] || a2enmod rewrite
# create symlink if not existing
[ -f /etc/apache2/conf.d/pnp4nagios.conf ] || ln -vs ../conf-available/pnp4nagios.conf /etc/apache2/conf.d/pnp4nagios.conf
# reload webserver
[ -x $(which invoke-rc.d) ] && invoke-rc.d apache2 reload
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

View File

@ -0,0 +1,54 @@
#!/bin/sh
# postrm script for pnp4nagios-web-config-icinga
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <overwriter>
# <overwriter-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
purge|remove)
# Apache2
if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
echo "disabling Apache2 configuration ..."
. /usr/share/apache2/apache2-maintscript-helper
apache2_invoke disconf pnp4nagios-web
fi
if [ -L /etc/apache2/conf.d/pnp4nagios-web.conf ]; then
echo "removing link /etc/apache2/conf.d/pnp4nagios-web.conf ..."
# remove link to config
rm -f /etc/apache2/conf.d/pnp4nagios-web.conf
# reload webserver
[ -x $(which invoke-rc.d) ] && invoke-rc.d apache2 reload || true
fi
;;
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

View File

@ -0,0 +1,2 @@
debian/nagios4/config.nagios4.php etc/pnp4nagios
debian/nagios4/pnp4nagios.conf etc/apache2/conf-available

View File

@ -0,0 +1,7 @@
# ignoring apache2 warning
# this is actually not a problem, because the handling is backwards compatible
apache2-reverse-dependency-calls-invoke-rc.d postrm
apache2-reverse-dependency-calls-wrapper-script postinst a2enmod
apache2-reverse-dependency-calls-invoke-rc.d postinst
# we actually want that
non-standard-apache2-configuration-name pnp4nagios.conf != pnp4nagios-web-config-nagios4.conf

View File

@ -0,0 +1,63 @@
#!/bin/sh
# postinst script for pnp4nagios-web-config-nagios4
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
echo "enabling Apache2 config..."
COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true)
# NEW method for Apache >= 2.4
if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
. /usr/share/apache2/apache2-maintscript-helper
apache2_invoke enmod rewrite
apache2_invoke enconf pnp4nagios
# remove OLD Apache 2.2 link
[ -L /etc/apache2/conf.d/pnp4nagios-web.conf ] && rm /etc/apache2/conf.d/pnp4nagios-web.conf
# OLD methods for Apache < 2.4
elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
# enable mod rewrite
[ -f /etc/apache2/mods-enabled/rewrite.load ] || a2enmod rewrite
# create symlink if not existing
[ -f /etc/apache2/conf.d/pnp4nagios.conf ] || ln -vs ../conf-available/pnp4nagios.conf /etc/apache2/conf.d/pnp4nagios.conf
# reload webserver
[ -x $(which invoke-rc.d) ] && invoke-rc.d apache2 reload
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

View File

@ -0,0 +1,54 @@
#!/bin/sh
# postrm script for pnp4nagios-web-config-nagios4
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <overwriter>
# <overwriter-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
purge|remove)
# Apache2
if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
echo "disabling Apache2 configuration ..."
. /usr/share/apache2/apache2-maintscript-helper
apache2_invoke disconf pnp4nagios-web
fi
if [ -L /etc/apache2/conf.d/pnp4nagios-web.conf ]; then
echo "removing link /etc/apache2/conf.d/pnp4nagios-web.conf ..."
# remove link to config
rm -f /etc/apache2/conf.d/pnp4nagios-web.conf
# reload webserver
[ -x $(which invoke-rc.d) ] && invoke-rc.d apache2 reload || true
fi
;;
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

1
debian/pnp4nagios-web.examples vendored Normal file
View File

@ -0,0 +1 @@
sample-config/httpd.conf

14
debian/pnp4nagios-web.install vendored Normal file
View File

@ -0,0 +1,14 @@
etc/pnp4nagios/config.php
etc/pnp4nagios/background.pdf
etc/pnp4nagios/templates/
etc/pnp4nagios/templates.d/
etc/pnp4nagios/pages/
etc/pnp4nagios/templates.special/
etc/pnp4nagios/pnp4nagios_release
usr/share/doc/pnp4nagios/examples/templates.special/
usr/share/doc/pnp4nagios/examples/pages/
usr/share/doc/pnp4nagios/examples/ssi/
usr/share/pnp4nagios/html/
usr/lib/pnp4nagios/kohana/
var/log/pnp4nagios/kohana/
var/lib/pnp4nagios/

60
debian/pnp4nagios-web.postinst vendored Normal file
View File

@ -0,0 +1,60 @@
#!/bin/sh
# postinst script for pnp4nagios-web
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
setperm() {
user="$1"
group="$2"
mode="$3"
file="$4"
shift 4
# only do something when no setting exists
if ! dpkg-statoverride --list "$file" >/dev/null 2>&1; then
chown "$user":"$group" "$file"
chmod "$mode" "$file"
fi
}
case "$1" in
configure)
if ! getent passwd nagios > /dev/null ; then
echo 'Adding system-user for nagios' 1>&2
adduser --system --group --home /var/lib/nagios \
--disabled-login --force-badname nagios > /dev/null
fi
setperm nagios www-data 750 /var/lib/pnp4nagios
setperm nagios nagios 755 /var/lib/pnp4nagios/perfdata
setperm nagios www-data 750 /var/log/pnp4nagios
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

113
debian/rules vendored Executable file
View File

@ -0,0 +1,113 @@
#!/usr/bin/make -f
# debian/rules for PNP4Nagios
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CFLAGS += -Wextra
%:
dh $@ --with autoreconf,autotools_dev
override_dh_auto_configure:
dh_auto_configure -- \
--with-layout=debian \
--mandir=/usr/share/man \
--infodir=/usr/share/info
# --without-kohana \
# --with-kohana_system=/usr/share/php/kohana2/system
override_dh_auto_build:
dh_auto_build -- all
#python -m jsmin share/pnp/media/js/jquery.imgareaselect.js \
# > share/pnp/media/js/jquery.imgareaselect.min.js
override_dh_auto_install:
dh_auto_install -- install-config
# Ignore install.php (for future debugging don't delete it)
touch debian/tmp/usr/share/pnp4nagios/html/install.ignore
mkdir -p debian/tmp/usr/share/doc/pnp4nagios/examples/
# Move template config dir to /etc/pnp4nagios/templates
rmdir debian/tmp/usr/share/pnp4nagios/html/templates
mkdir debian/tmp/etc/pnp4nagios/templates
mv debian/tmp/usr/share/pnp4nagios/html/templates.special \
debian/tmp/usr/share/doc/pnp4nagios/examples/
mkdir debian/tmp/etc/pnp4nagios/templates.special
mkdir -p debian/tmp/usr/sbin/
mv debian/tmp/usr/bin/npcd \
debian/tmp/usr/sbin/
mv debian/tmp/etc/pnp4nagios/rra.cfg-sample \
debian/tmp/etc/pnp4nagios/rra.cfg
mv debian/tmp/etc/pnp4nagios/nagios.cfg-sample \
debian/tmp/usr/share/doc/pnp4nagios/examples/nagios.cfg
mv debian/tmp/etc/pnp4nagios/misccommands.cfg-sample \
debian/tmp/usr/share/doc/pnp4nagios/examples/misccommands.cfg
mkdir debian/tmp/usr/share/doc/pnp4nagios/examples/check_commands
mv debian/tmp/etc/pnp4nagios/check_commands/check_nwstat.cfg-sample \
debian/tmp/usr/share/doc/pnp4nagios/examples/check_commands/check_nwstat.cfg
mkdir debian/tmp/usr/share/doc/pnp4nagios/examples/pages
mv debian/tmp/etc/pnp4nagios/pages/web_traffic.cfg-sample \
debian/tmp/usr/share/doc/pnp4nagios/examples/pages/web_traffic.cfg
cp -av contrib/ssi debian/tmp/usr/share/doc/pnp4nagios/examples/
rm -fv debian/tmp/usr/share/doc/pnp4nagios/examples/ssi/*.in
# Icinga module sample configuration
cp debian/icinga-module.cfg debian/tmp/usr/share/doc/pnp4nagios/examples/
# Remove external PHP classes/libraries: FPDF, FPDF-TPL, FPDI
#rm -r debian/tmp/usr/share/pnp4nagios/html/application/vendor/fpdf
# remove source files
#rm -f debian/tmp/usr/share/pnp4nagios/html/media/js/jquery.imgareaselect.Debian.txt
#rm -f debian/tmp/usr/share/pnp4nagios/html/media/js/jquery.imgareaselect.js
# Remove external JavaScript files: jQuery and jQuery-UI
# no longer present in DFSG tarball
#rm debian/tmp/usr/share/pnp4nagios/html/media/js/jquery-min.js
#rm debian/tmp/usr/share/pnp4nagios/html/media/js/jquery-ui.min.js
# Clean up some files
rmdir debian/tmp/usr/bin
mv debian/tmp/etc/pnp4nagios/check_commands/check_all_local_disks.cfg-sample \
debian/tmp/etc/pnp4nagios/check_commands/check_all_local_disks.cfg
rm debian/tmp/etc/pnp4nagios/check_commands/check_nrpe.cfg-sample
# Add Debian specific config and placeholder files
#touch debian/tmp/etc/pnp4nagios/pages/.placeholder
cp -av debian/nagios.cfg debian/tmp/etc/pnp4nagios/
cp -av debian/check_commands/* debian/tmp/etc/pnp4nagios/check_commands/
# Remove unnecessary config files (duplicates)
rm -f debian/tmp/etc/pnp4nagios/config_local.php
rm -f debian/tmp/etc/pnp4nagios/config.php.0.6*
# Add subdirs to /var/spool/pnp4nagios/ to prepare for different modes
mkdir debian/tmp/var/spool/pnp4nagios/nagios
mkdir debian/tmp/var/spool/pnp4nagios/npcd
# Delete not used and empty directories
#rmdir debian/tmp/usr/share/pnp4nagios/html/application/logs/
rmdir debian/tmp/usr/share/pnp4nagios/html/application/cache/
rmdir debian/tmp/usr/share/pnp4nagios/html/application/hooks/
#rmdir debian/tmp/usr/share/pnp4nagios/html/application/libraries/
mkdir debian/tmp/etc/pnp4nagios/templates.d
cp debian/README.templates.d debian/tmp/etc/pnp4nagios/templates.d/README
override_dh_installinit:
dh_installinit -ppnp4nagios-bin --name=npcd
dh_installinit -ppnp4nagios-bin --name=pnp_gearman_worker
# vi: noexpandtab ts=4 sw=4 :

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

3
debian/watch vendored Normal file
View File

@ -0,0 +1,3 @@
version=3
opts="dversionmangle=s/\+dfsg\d*//,uversionmangle=s/\.rc/~rc/" \
http://sf.net/pnp4nagios/pnp4nagios-(.+)\.tar\.gz

16
helpers/kohana-install.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
#
# PNP4Nagios Helper Script
#
DIR=`dirname $0`
cd $DIR/../lib/kohana
for D in `find . -type d -printf "%P\n"`;do
if [ "$D" != "" ];then
echo -e "\t\$(INSTALL) -m 755 \$(INSTALL_OPTS) -d \$(DESTDIR)\$(LIBDIR)/kohana/$D"
fi
done
for F in `find . -type f -printf "%P\n"`;do
if [ "$F" != "" ];then
echo -e "\t\$(INSTALL) -m 644 \$(INSTALL_OPTS) kohana/$F \$(DESTDIR)\$(LIBDIR)/kohana/$F"
fi
done

42
helpers/wiki2html.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
#set -xv
LANG="de en"
LANG_TARGET=(de_DE en_US)
FILES=( about advanced config doc_complete dwnld install modes new-features npcd pages perfdata_format rrdcached rrd_convert start timeranges tpl_helper tpl_helper_pnp tpl_custom tpl upgrade verify verify_pnp_config webfe_cfg webfe wrapper xport mobile )
DESTDIR="../share/pnp/documents"
URL="http://docs.pnp4nagios.org"
cd $DESTDIR
lindex=0
for L in $LANG; do
if [ "$L" == "en" ];then
PART="pnp-0.6"
else
PART="$L/pnp-0.6"
fi
T=${LANG_TARGET[$lindex]}
mkdir $T
index=0
documents=${#FILES[@]}
while [ "$index" -lt "$documents" ];do
F=${FILES[$index]}
echo "$L $F"
wget -nv -O "${T}/${F}.html" "${URL}/${PART}/${F}?do=export_xhtmlbody"
sed -i -e's/ü/\&uuml;/g' "${T}/${F}.html"
sed -i -e's/Ü/\&Uuml;/g' "${T}/${F}.html"
sed -i -e's/ä/\&auml;/g' "${T}/${F}.html"
sed -i -e's/Ä/\&Auml;/g' "${T}/${F}.html"
sed -i -e's/ö/\&ouml;/g' "${T}/${F}.html"
sed -i -e's/Ö/\&Ouml;/g' "${T}/${F}.html"
((index++))
done
((lindex++))
done
rm de_DE/dwnld.html
ln -s en_US/dwnld.html de_DE/dwnld.html

222
include/broker.h Normal file
View File

@ -0,0 +1,222 @@
/*****************************************************************************
*
* BROKER.H - Event broker includes for Nagios
*
* Copyright (c) 2002-2006 Ethan Galstad (nagios@nagios.org)
* Last Modified: 12-12-2006
*
* License:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*****************************************************************************/
#ifndef _BROKER_H
#define _BROKER_H
#include "config.h"
#include "nagios.h"
#ifdef __cplusplus
extern "C" {
#endif
/*************** EVENT BROKER OPTIONS *****************/
#define BROKER_NOTHING 0
#define BROKER_EVERYTHING 1048575
#define BROKER_PROGRAM_STATE 1 /* DONE */
#define BROKER_TIMED_EVENTS 2 /* DONE */
#define BROKER_SERVICE_CHECKS 4 /* DONE */
#define BROKER_HOST_CHECKS 8 /* DONE */
#define BROKER_EVENT_HANDLERS 16 /* DONE */
#define BROKER_LOGGED_DATA 32 /* DONE */
#define BROKER_NOTIFICATIONS 64 /* DONE */
#define BROKER_FLAPPING_DATA 128 /* DONE */
#define BROKER_COMMENT_DATA 256 /* DONE */
#define BROKER_DOWNTIME_DATA 512 /* DONE */
#define BROKER_SYSTEM_COMMANDS 1024 /* DONE */
#define BROKER_OCP_DATA 2048 /* DONE */
#define BROKER_STATUS_DATA 4096 /* DONE */
#define BROKER_ADAPTIVE_DATA 8192 /* DONE */
#define BROKER_EXTERNALCOMMAND_DATA 16384 /* DONE */
#define BROKER_RETENTION_DATA 32768 /* DONE */
#define BROKER_ACKNOWLEDGEMENT_DATA 65536
#define BROKER_STATECHANGE_DATA 131072
#define BROKER_RESERVED18 262144
#define BROKER_RESERVED19 524288
/****** EVENT TYPES ************************/
#define NEBTYPE_NONE 0
#define NEBTYPE_HELLO 1
#define NEBTYPE_GOODBYE 2
#define NEBTYPE_INFO 3
#define NEBTYPE_PROCESS_START 100
#define NEBTYPE_PROCESS_DAEMONIZE 101
#define NEBTYPE_PROCESS_RESTART 102
#define NEBTYPE_PROCESS_SHUTDOWN 103
#define NEBTYPE_PROCESS_PRELAUNCH 104 /* before objects are read or verified */
#define NEBTYPE_PROCESS_EVENTLOOPSTART 105
#define NEBTYPE_PROCESS_EVENTLOOPEND 106
#define NEBTYPE_TIMEDEVENT_ADD 200
#define NEBTYPE_TIMEDEVENT_REMOVE 201
#define NEBTYPE_TIMEDEVENT_EXECUTE 202
#define NEBTYPE_TIMEDEVENT_DELAY 203 /* NOT IMPLEMENTED */
#define NEBTYPE_TIMEDEVENT_SKIP 204 /* NOT IMPLEMENTED */
#define NEBTYPE_TIMEDEVENT_SLEEP 205
#define NEBTYPE_LOG_DATA 300
#define NEBTYPE_LOG_ROTATION 301
#define NEBTYPE_SYSTEM_COMMAND_START 400
#define NEBTYPE_SYSTEM_COMMAND_END 401
#define NEBTYPE_EVENTHANDLER_START 500
#define NEBTYPE_EVENTHANDLER_END 501
#define NEBTYPE_NOTIFICATION_START 600
#define NEBTYPE_NOTIFICATION_END 601
#define NEBTYPE_CONTACTNOTIFICATION_START 602
#define NEBTYPE_CONTACTNOTIFICATION_END 603
#define NEBTYPE_CONTACTNOTIFICATIONMETHOD_START 604
#define NEBTYPE_CONTACTNOTIFICATIONMETHOD_END 605
#define NEBTYPE_SERVICECHECK_INITIATE 700
#define NEBTYPE_SERVICECHECK_PROCESSED 701
#define NEBTYPE_SERVICECHECK_RAW_START 702 /* NOT IMPLEMENTED */
#define NEBTYPE_SERVICECHECK_RAW_END 703 /* NOT IMPLEMENTED */
#define NEBTYPE_SERVICECHECK_ASYNC_PRECHECK 704
#define NEBTYPE_HOSTCHECK_INITIATE 800 /* a check of the route to the host has been initiated */
#define NEBTYPE_HOSTCHECK_PROCESSED 801 /* the processed/final result of a host check */
#define NEBTYPE_HOSTCHECK_RAW_START 802 /* the start of a "raw" host check */
#define NEBTYPE_HOSTCHECK_RAW_END 803 /* a finished "raw" host check */
#define NEBTYPE_HOSTCHECK_ASYNC_PRECHECK 804
#define NEBTYPE_HOSTCHECK_SYNC_PRECHECK 805
#define NEBTYPE_COMMENT_ADD 900
#define NEBTYPE_COMMENT_DELETE 901
#define NEBTYPE_COMMENT_LOAD 902
#define NEBTYPE_FLAPPING_START 1000
#define NEBTYPE_FLAPPING_STOP 1001
#define NEBTYPE_DOWNTIME_ADD 1100
#define NEBTYPE_DOWNTIME_DELETE 1101
#define NEBTYPE_DOWNTIME_LOAD 1102
#define NEBTYPE_DOWNTIME_START 1103
#define NEBTYPE_DOWNTIME_STOP 1104
#define NEBTYPE_PROGRAMSTATUS_UPDATE 1200
#define NEBTYPE_HOSTSTATUS_UPDATE 1201
#define NEBTYPE_SERVICESTATUS_UPDATE 1202
#define NEBTYPE_CONTACTSTATUS_UPDATE 1203
#define NEBTYPE_ADAPTIVEPROGRAM_UPDATE 1300
#define NEBTYPE_ADAPTIVEHOST_UPDATE 1301
#define NEBTYPE_ADAPTIVESERVICE_UPDATE 1302
#define NEBTYPE_ADAPTIVECONTACT_UPDATE 1303
#define NEBTYPE_EXTERNALCOMMAND_START 1400
#define NEBTYPE_EXTERNALCOMMAND_END 1401
#define NEBTYPE_AGGREGATEDSTATUS_STARTDUMP 1500
#define NEBTYPE_AGGREGATEDSTATUS_ENDDUMP 1501
#define NEBTYPE_RETENTIONDATA_STARTLOAD 1600
#define NEBTYPE_RETENTIONDATA_ENDLOAD 1601
#define NEBTYPE_RETENTIONDATA_STARTSAVE 1602
#define NEBTYPE_RETENTIONDATA_ENDSAVE 1603
#define NEBTYPE_ACKNOWLEDGEMENT_ADD 1700
#define NEBTYPE_ACKNOWLEDGEMENT_REMOVE 1701 /* NOT IMPLEMENTED */
#define NEBTYPE_ACKNOWLEDGEMENT_LOAD 1702 /* NOT IMPLEMENTED */
#define NEBTYPE_STATECHANGE_START 1800 /* NOT IMPLEMENTED */
#define NEBTYPE_STATECHANGE_END 1801
/****** EVENT FLAGS ************************/
#define NEBFLAG_NONE 0
#define NEBFLAG_PROCESS_INITIATED 1 /* event was initiated by Nagios process */
#define NEBFLAG_USER_INITIATED 2 /* event was initiated by a user request */
#define NEBFLAG_MODULE_INITIATED 3 /* event was initiated by an event broker module */
/****** EVENT ATTRIBUTES *******************/
#define NEBATTR_NONE 0
#define NEBATTR_SHUTDOWN_NORMAL 1
#define NEBATTR_SHUTDOWN_ABNORMAL 2
#define NEBATTR_RESTART_NORMAL 4
#define NEBATTR_RESTART_ABNORMAL 8
#define NEBATTR_FLAPPING_STOP_NORMAL 1
#define NEBATTR_FLAPPING_STOP_DISABLED 2 /* flapping stopped because flap detection was disabled */
#define NEBATTR_DOWNTIME_STOP_NORMAL 1
#define NEBATTR_DOWNTIME_STOP_CANCELLED 2
/****** EVENT BROKER FUNCTIONS *************/
#ifdef USE_EVENT_BROKER
struct timeval get_broker_timestamp(struct timeval *);
void broker_program_state(int,int,int,struct timeval *);
void broker_timed_event(int,int,int,timed_event *,struct timeval *);
void broker_log_data(int,int,int,char *,unsigned long,time_t,struct timeval *);
void broker_event_handler(int,int,int,int,void *,int,int,struct timeval,struct timeval,double,int,int,int,char *,char *,char *,struct timeval *);
void broker_ocp_data(int,int,int,void *,int,int,double,int,int,struct timeval *);
void broker_system_command(int,int,int,struct timeval,struct timeval,double,int,int,int,char *,char *,struct timeval *);
int broker_host_check(int,int,int,host *,int,int,int,struct timeval,struct timeval,char *,double,double,int,int,int,char *,char *,char *,char *,struct timeval *);
int broker_service_check(int,int,int,service *,int,struct timeval,struct timeval,char *,double,double,int,int,int,char *,struct timeval *);
void broker_comment_data(int,int,int,int,int,char *,char *,time_t,char *,char *,int,int,int,time_t,unsigned long,struct timeval *);
void broker_downtime_data(int,int,int,int,char *,char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long,struct timeval *);
void broker_flapping_data(int,int,int,int,void *,double,double,double,struct timeval *);
void broker_program_status(int,int,int,struct timeval *);
void broker_host_status(int,int,int,host *,struct timeval *);
void broker_service_status(int,int,int,service *,struct timeval *);
void broker_contact_status(int,int,int,contact *,struct timeval *);
void broker_notification_data(int,int,int,int,int,struct timeval,struct timeval,void *,char *,char *,int,int,struct timeval *);
void broker_contact_notification_data(int,int,int,int,int,struct timeval,struct timeval,void *,contact *,char *,char *,int,struct timeval *);
void broker_contact_notification_method_data(int,int,int,int,int,struct timeval,struct timeval,void *,contact *,char *,char *,char *,int,struct timeval *);
void broker_adaptive_program_data(int,int,int,int,unsigned long,unsigned long,unsigned long,unsigned long,struct timeval *);
void broker_adaptive_host_data(int,int,int,host *,int,unsigned long,unsigned long,struct timeval *);
void broker_adaptive_service_data(int,int,int,service *,int,unsigned long,unsigned long,struct timeval *);
void broker_adaptive_contact_data(int,int,int,contact *,int,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long, struct timeval *);
void broker_external_command(int,int,int,int,time_t,char *,char *,struct timeval *);
void broker_aggregated_status_data(int,int,int,struct timeval *);
void broker_retention_data(int,int,int,struct timeval *);
void broker_acknowledgement_data(int,int,int,int,void *,char *,char *,int,int,int,struct timeval *);
void broker_statechange_data(int,int,int,int,void *,int,int,int,int,struct timeval *);
#endif
#ifdef __cplusplus
}
#endif
#endif

500
include/common.h Normal file
View File

@ -0,0 +1,500 @@
/************************************************************************
*
* Nagios Common Header File
* Written By: Ethan Galstad (nagios@nagios.org)
* Last Modified: 10-22-2007
*
* License:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
************************************************************************/
#define PROGRAM_VERSION "3.0"
#define PROGRAM_MODIFICATION_DATE "03-13-2008"
/*#define DEBUG_CHECK_IPC 1 */
/*#define DEBUG_CHECK_IPC2 1*/
/* daemon is thread safe */
#ifdef NSCORE
#ifndef _REENTRANT
#define _REENTRANT
#endif
#ifndef _THREAD_SAFE
#define _THREAD_SAFE
#endif
#endif
/* Experimental performance tweaks - use with caution */
#undef USE_MEMORY_PERFORMANCE_TWEAKS
/* my_free has been freed from bondage as a function */
#define my_free(ptr) { if(ptr) { free(ptr); ptr = NULL; } }
/***************************** COMMANDS *********************************/
#define CMD_NONE 0
#define CMD_ADD_HOST_COMMENT 1
#define CMD_DEL_HOST_COMMENT 2
#define CMD_ADD_SVC_COMMENT 3
#define CMD_DEL_SVC_COMMENT 4
#define CMD_ENABLE_SVC_CHECK 5
#define CMD_DISABLE_SVC_CHECK 6
#define CMD_SCHEDULE_SVC_CHECK 7
#define CMD_DELAY_SVC_NOTIFICATION 9
#define CMD_DELAY_HOST_NOTIFICATION 10
#define CMD_DISABLE_NOTIFICATIONS 11
#define CMD_ENABLE_NOTIFICATIONS 12
#define CMD_RESTART_PROCESS 13
#define CMD_SHUTDOWN_PROCESS 14
#define CMD_ENABLE_HOST_SVC_CHECKS 15
#define CMD_DISABLE_HOST_SVC_CHECKS 16
#define CMD_SCHEDULE_HOST_SVC_CHECKS 17
#define CMD_DELAY_HOST_SVC_NOTIFICATIONS 19 /* currently unimplemented */
#define CMD_DEL_ALL_HOST_COMMENTS 20
#define CMD_DEL_ALL_SVC_COMMENTS 21
#define CMD_ENABLE_SVC_NOTIFICATIONS 22
#define CMD_DISABLE_SVC_NOTIFICATIONS 23
#define CMD_ENABLE_HOST_NOTIFICATIONS 24
#define CMD_DISABLE_HOST_NOTIFICATIONS 25
#define CMD_ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST 26
#define CMD_DISABLE_ALL_NOTIFICATIONS_BEYOND_HOST 27
#define CMD_ENABLE_HOST_SVC_NOTIFICATIONS 28
#define CMD_DISABLE_HOST_SVC_NOTIFICATIONS 29
#define CMD_PROCESS_SERVICE_CHECK_RESULT 30
#define CMD_SAVE_STATE_INFORMATION 31
#define CMD_READ_STATE_INFORMATION 32
#define CMD_ACKNOWLEDGE_HOST_PROBLEM 33
#define CMD_ACKNOWLEDGE_SVC_PROBLEM 34
#define CMD_START_EXECUTING_SVC_CHECKS 35
#define CMD_STOP_EXECUTING_SVC_CHECKS 36
#define CMD_START_ACCEPTING_PASSIVE_SVC_CHECKS 37
#define CMD_STOP_ACCEPTING_PASSIVE_SVC_CHECKS 38
#define CMD_ENABLE_PASSIVE_SVC_CHECKS 39
#define CMD_DISABLE_PASSIVE_SVC_CHECKS 40
#define CMD_ENABLE_EVENT_HANDLERS 41
#define CMD_DISABLE_EVENT_HANDLERS 42
#define CMD_ENABLE_HOST_EVENT_HANDLER 43
#define CMD_DISABLE_HOST_EVENT_HANDLER 44
#define CMD_ENABLE_SVC_EVENT_HANDLER 45
#define CMD_DISABLE_SVC_EVENT_HANDLER 46
#define CMD_ENABLE_HOST_CHECK 47
#define CMD_DISABLE_HOST_CHECK 48
#define CMD_START_OBSESSING_OVER_SVC_CHECKS 49
#define CMD_STOP_OBSESSING_OVER_SVC_CHECKS 50
#define CMD_REMOVE_HOST_ACKNOWLEDGEMENT 51
#define CMD_REMOVE_SVC_ACKNOWLEDGEMENT 52
#define CMD_SCHEDULE_FORCED_HOST_SVC_CHECKS 53
#define CMD_SCHEDULE_FORCED_SVC_CHECK 54
#define CMD_SCHEDULE_HOST_DOWNTIME 55
#define CMD_SCHEDULE_SVC_DOWNTIME 56
#define CMD_ENABLE_HOST_FLAP_DETECTION 57
#define CMD_DISABLE_HOST_FLAP_DETECTION 58
#define CMD_ENABLE_SVC_FLAP_DETECTION 59
#define CMD_DISABLE_SVC_FLAP_DETECTION 60
#define CMD_ENABLE_FLAP_DETECTION 61
#define CMD_DISABLE_FLAP_DETECTION 62
#define CMD_ENABLE_HOSTGROUP_SVC_NOTIFICATIONS 63
#define CMD_DISABLE_HOSTGROUP_SVC_NOTIFICATIONS 64
#define CMD_ENABLE_HOSTGROUP_HOST_NOTIFICATIONS 65
#define CMD_DISABLE_HOSTGROUP_HOST_NOTIFICATIONS 66
#define CMD_ENABLE_HOSTGROUP_SVC_CHECKS 67
#define CMD_DISABLE_HOSTGROUP_SVC_CHECKS 68
#define CMD_CANCEL_HOST_DOWNTIME 69 /* not internally implemented */
#define CMD_CANCEL_SVC_DOWNTIME 70 /* not internally implemented */
#define CMD_CANCEL_ACTIVE_HOST_DOWNTIME 71 /* old - no longer used */
#define CMD_CANCEL_PENDING_HOST_DOWNTIME 72 /* old - no longer used */
#define CMD_CANCEL_ACTIVE_SVC_DOWNTIME 73 /* old - no longer used */
#define CMD_CANCEL_PENDING_SVC_DOWNTIME 74 /* old - no longer used */
#define CMD_CANCEL_ACTIVE_HOST_SVC_DOWNTIME 75 /* unimplemented */
#define CMD_CANCEL_PENDING_HOST_SVC_DOWNTIME 76 /* unimplemented */
#define CMD_FLUSH_PENDING_COMMANDS 77
#define CMD_DEL_HOST_DOWNTIME 78
#define CMD_DEL_SVC_DOWNTIME 79
#define CMD_ENABLE_FAILURE_PREDICTION 80
#define CMD_DISABLE_FAILURE_PREDICTION 81
#define CMD_ENABLE_PERFORMANCE_DATA 82
#define CMD_DISABLE_PERFORMANCE_DATA 83
#define CMD_SCHEDULE_HOSTGROUP_HOST_DOWNTIME 84
#define CMD_SCHEDULE_HOSTGROUP_SVC_DOWNTIME 85
#define CMD_SCHEDULE_HOST_SVC_DOWNTIME 86
/* new commands in Nagios 2.x found below... */
#define CMD_PROCESS_HOST_CHECK_RESULT 87
#define CMD_START_EXECUTING_HOST_CHECKS 88
#define CMD_STOP_EXECUTING_HOST_CHECKS 89
#define CMD_START_ACCEPTING_PASSIVE_HOST_CHECKS 90
#define CMD_STOP_ACCEPTING_PASSIVE_HOST_CHECKS 91
#define CMD_ENABLE_PASSIVE_HOST_CHECKS 92
#define CMD_DISABLE_PASSIVE_HOST_CHECKS 93
#define CMD_START_OBSESSING_OVER_HOST_CHECKS 94
#define CMD_STOP_OBSESSING_OVER_HOST_CHECKS 95
#define CMD_SCHEDULE_HOST_CHECK 96
#define CMD_SCHEDULE_FORCED_HOST_CHECK 98
#define CMD_START_OBSESSING_OVER_SVC 99
#define CMD_STOP_OBSESSING_OVER_SVC 100
#define CMD_START_OBSESSING_OVER_HOST 101
#define CMD_STOP_OBSESSING_OVER_HOST 102
#define CMD_ENABLE_HOSTGROUP_HOST_CHECKS 103
#define CMD_DISABLE_HOSTGROUP_HOST_CHECKS 104
#define CMD_ENABLE_HOSTGROUP_PASSIVE_SVC_CHECKS 105
#define CMD_DISABLE_HOSTGROUP_PASSIVE_SVC_CHECKS 106
#define CMD_ENABLE_HOSTGROUP_PASSIVE_HOST_CHECKS 107
#define CMD_DISABLE_HOSTGROUP_PASSIVE_HOST_CHECKS 108
#define CMD_ENABLE_SERVICEGROUP_SVC_NOTIFICATIONS 109
#define CMD_DISABLE_SERVICEGROUP_SVC_NOTIFICATIONS 110
#define CMD_ENABLE_SERVICEGROUP_HOST_NOTIFICATIONS 111
#define CMD_DISABLE_SERVICEGROUP_HOST_NOTIFICATIONS 112
#define CMD_ENABLE_SERVICEGROUP_SVC_CHECKS 113
#define CMD_DISABLE_SERVICEGROUP_SVC_CHECKS 114
#define CMD_ENABLE_SERVICEGROUP_HOST_CHECKS 115
#define CMD_DISABLE_SERVICEGROUP_HOST_CHECKS 116
#define CMD_ENABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS 117
#define CMD_DISABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS 118
#define CMD_ENABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS 119
#define CMD_DISABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS 120
#define CMD_SCHEDULE_SERVICEGROUP_HOST_DOWNTIME 121
#define CMD_SCHEDULE_SERVICEGROUP_SVC_DOWNTIME 122
#define CMD_CHANGE_GLOBAL_HOST_EVENT_HANDLER 123
#define CMD_CHANGE_GLOBAL_SVC_EVENT_HANDLER 124
#define CMD_CHANGE_HOST_EVENT_HANDLER 125
#define CMD_CHANGE_SVC_EVENT_HANDLER 126
#define CMD_CHANGE_HOST_CHECK_COMMAND 127
#define CMD_CHANGE_SVC_CHECK_COMMAND 128
#define CMD_CHANGE_NORMAL_HOST_CHECK_INTERVAL 129
#define CMD_CHANGE_NORMAL_SVC_CHECK_INTERVAL 130
#define CMD_CHANGE_RETRY_SVC_CHECK_INTERVAL 131
#define CMD_CHANGE_MAX_HOST_CHECK_ATTEMPTS 132
#define CMD_CHANGE_MAX_SVC_CHECK_ATTEMPTS 133
#define CMD_SCHEDULE_AND_PROPAGATE_TRIGGERED_HOST_DOWNTIME 134
#define CMD_ENABLE_HOST_AND_CHILD_NOTIFICATIONS 135
#define CMD_DISABLE_HOST_AND_CHILD_NOTIFICATIONS 136
#define CMD_SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME 137
#define CMD_ENABLE_SERVICE_FRESHNESS_CHECKS 138
#define CMD_DISABLE_SERVICE_FRESHNESS_CHECKS 139
#define CMD_ENABLE_HOST_FRESHNESS_CHECKS 140
#define CMD_DISABLE_HOST_FRESHNESS_CHECKS 141
#define CMD_SET_HOST_NOTIFICATION_NUMBER 142
#define CMD_SET_SVC_NOTIFICATION_NUMBER 143
/* new commands in Nagios 3.x found below... */
#define CMD_CHANGE_HOST_CHECK_TIMEPERIOD 144
#define CMD_CHANGE_SVC_CHECK_TIMEPERIOD 145
#define CMD_PROCESS_FILE 146
#define CMD_CHANGE_CUSTOM_HOST_VAR 147
#define CMD_CHANGE_CUSTOM_SVC_VAR 148
#define CMD_CHANGE_CUSTOM_CONTACT_VAR 149
#define CMD_ENABLE_CONTACT_HOST_NOTIFICATIONS 150
#define CMD_DISABLE_CONTACT_HOST_NOTIFICATIONS 151
#define CMD_ENABLE_CONTACT_SVC_NOTIFICATIONS 152
#define CMD_DISABLE_CONTACT_SVC_NOTIFICATIONS 153
#define CMD_ENABLE_CONTACTGROUP_HOST_NOTIFICATIONS 154
#define CMD_DISABLE_CONTACTGROUP_HOST_NOTIFICATIONS 155
#define CMD_ENABLE_CONTACTGROUP_SVC_NOTIFICATIONS 156
#define CMD_DISABLE_CONTACTGROUP_SVC_NOTIFICATIONS 157
#define CMD_CHANGE_RETRY_HOST_CHECK_INTERVAL 158
#define CMD_SEND_CUSTOM_HOST_NOTIFICATION 159
#define CMD_SEND_CUSTOM_SVC_NOTIFICATION 160
#define CMD_CHANGE_HOST_NOTIFICATION_TIMEPERIOD 161
#define CMD_CHANGE_SVC_NOTIFICATION_TIMEPERIOD 162
#define CMD_CHANGE_CONTACT_HOST_NOTIFICATION_TIMEPERIOD 163
#define CMD_CHANGE_CONTACT_SVC_NOTIFICATION_TIMEPERIOD 164
#define CMD_CHANGE_HOST_MODATTR 165
#define CMD_CHANGE_SVC_MODATTR 166
#define CMD_CHANGE_CONTACT_MODATTR 167
#define CMD_CHANGE_CONTACT_MODHATTR 168
#define CMD_CHANGE_CONTACT_MODSATTR 169
/* custom command introduced in Nagios 3.x */
#define CMD_CUSTOM_COMMAND 999
/************************ SERVICE CHECK TYPES ****************************/
#define SERVICE_CHECK_ACTIVE 0 /* Nagios performed the service check */
#define SERVICE_CHECK_PASSIVE 1 /* the service check result was submitted by an external source */
/************************** HOST CHECK TYPES *****************************/
#define HOST_CHECK_ACTIVE 0 /* Nagios performed the host check */
#define HOST_CHECK_PASSIVE 1 /* the host check result was submitted by an external source */
/************************ SERVICE STATE TYPES ****************************/
#define SOFT_STATE 0
#define HARD_STATE 1
/************************* SCHEDULED DOWNTIME TYPES **********************/
#define SERVICE_DOWNTIME 1 /* service downtime */
#define HOST_DOWNTIME 2 /* host downtime */
#define ANY_DOWNTIME 3 /* host or service downtime */
/************************** NOTIFICATION OPTIONS *************************/
#define NOTIFICATION_OPTION_NONE 0
#define NOTIFICATION_OPTION_BROADCAST 1
#define NOTIFICATION_OPTION_FORCED 2
#define NOTIFICATION_OPTION_INCREMENT 4
/************************** ACKNOWLEDGEMENT TYPES ************************/
#define HOST_ACKNOWLEDGEMENT 0
#define SERVICE_ACKNOWLEDGEMENT 1
#define ACKNOWLEDGEMENT_NONE 0
#define ACKNOWLEDGEMENT_NORMAL 1
#define ACKNOWLEDGEMENT_STICKY 2
/**************************** DEPENDENCY TYPES ***************************/
#define NOTIFICATION_DEPENDENCY 1
#define EXECUTION_DEPENDENCY 2
/********************** HOST/SERVICE CHECK OPTIONS ***********************/
#define CHECK_OPTION_NONE 0 /* no check options */
#define CHECK_OPTION_FORCE_EXECUTION 1 /* force execution of a check (ignores disabled services/hosts, invalid timeperiods) */
#define CHECK_OPTION_FRESHNESS_CHECK 2 /* this is a freshness check */
#define CHECK_OPTION_ORPHAN_CHECK 4 /* this is an orphan check */
/**************************** PROGRAM MODES ******************************/
#define STANDBY_MODE 0
#define ACTIVE_MODE 1
/************************** LOG ROTATION MODES ***************************/
#define LOG_ROTATION_NONE 0
#define LOG_ROTATION_HOURLY 1
#define LOG_ROTATION_DAILY 2
#define LOG_ROTATION_WEEKLY 3
#define LOG_ROTATION_MONTHLY 4
/***************************** LOG VERSIONS ******************************/
#define LOG_VERSION_1 "1.0"
#define LOG_VERSION_2 "2.0"
/*************************** CHECK STATISTICS ****************************/
#define ACTIVE_SCHEDULED_SERVICE_CHECK_STATS 0
#define ACTIVE_ONDEMAND_SERVICE_CHECK_STATS 1
#define PASSIVE_SERVICE_CHECK_STATS 2
#define ACTIVE_SCHEDULED_HOST_CHECK_STATS 3
#define ACTIVE_ONDEMAND_HOST_CHECK_STATS 4
#define PASSIVE_HOST_CHECK_STATS 5
#define ACTIVE_CACHED_HOST_CHECK_STATS 6
#define ACTIVE_CACHED_SERVICE_CHECK_STATS 7
#define EXTERNAL_COMMAND_STATS 8
#define PARALLEL_HOST_CHECK_STATS 9
#define SERIAL_HOST_CHECK_STATS 10
#define MAX_CHECK_STATS_TYPES 11
/************************* GENERAL DEFINITIONS **************************/
#define OK 0
#define ERROR -2 /* value was changed from -1 so as to not interfere with STATUS_UNKNOWN plugin result */
#ifndef TRUE
#define TRUE 1
#elif (TRUE!=1)
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#elif (FALSE!=0)
#define FALSE 0
#endif
/****************** HOST CONFIG FILE READING OPTIONS ********************/
#define READ_HOSTS 1
#define READ_HOSTGROUPS 2
#define READ_CONTACTS 4
#define READ_CONTACTGROUPS 8
#define READ_SERVICES 16
#define READ_COMMANDS 32
#define READ_TIMEPERIODS 64
#define READ_SERVICEESCALATIONS 128
#define READ_HOSTGROUPESCALATIONS 256 /* no longer implemented */
#define READ_SERVICEDEPENDENCIES 512
#define READ_HOSTDEPENDENCIES 1024
#define READ_HOSTESCALATIONS 2048
#define READ_HOSTEXTINFO 4096
#define READ_SERVICEEXTINFO 8192
#define READ_SERVICEGROUPS 16384
#define READ_ALL_OBJECT_DATA READ_HOSTS | READ_HOSTGROUPS | READ_CONTACTS | READ_CONTACTGROUPS | READ_SERVICES | READ_COMMANDS | READ_TIMEPERIODS | READ_SERVICEESCALATIONS | READ_SERVICEDEPENDENCIES | READ_HOSTDEPENDENCIES | READ_HOSTESCALATIONS | READ_HOSTEXTINFO | READ_SERVICEEXTINFO | READ_SERVICEGROUPS
/************************** DATE RANGE TYPES ****************************/
#define DATERANGE_CALENDAR_DATE 0 /* 2008-12-25 */
#define DATERANGE_MONTH_DATE 1 /* july 4 (specific month) */
#define DATERANGE_MONTH_DAY 2 /* day 21 (generic month) */
#define DATERANGE_MONTH_WEEK_DAY 3 /* 3rd thursday (specific month) */
#define DATERANGE_WEEK_DAY 4 /* 3rd thursday (generic month) */
#define DATERANGE_TYPES 5
/************************** DATE/TIME TYPES *****************************/
#define LONG_DATE_TIME 0
#define SHORT_DATE_TIME 1
#define SHORT_DATE 2
#define SHORT_TIME 3
#define HTTP_DATE_TIME 4 /* time formatted for use in HTTP headers */
/**************************** DATE FORMATS ******************************/
#define DATE_FORMAT_US 0 /* U.S. (MM-DD-YYYY HH:MM:SS) */
#define DATE_FORMAT_EURO 1 /* European (DD-MM-YYYY HH:MM:SS) */
#define DATE_FORMAT_ISO8601 2 /* ISO8601 (YYYY-MM-DD HH:MM:SS) */
#define DATE_FORMAT_STRICT_ISO8601 3 /* ISO8601 (YYYY-MM-DDTHH:MM:SS) */
/************************** MISC DEFINITIONS ****************************/
#define MAX_FILENAME_LENGTH 256 /* max length of path/filename that Nagios will process */
#define MAX_INPUT_BUFFER 1024 /* size in bytes of max. input buffer (for reading files, misc stuff) */
#define MAX_COMMAND_BUFFER 8192 /* max length of raw or processed command line */
#define MAX_EXTERNAL_COMMAND_LENGTH 8192 /* max length of an external command */
#define MAX_DATETIME_LENGTH 48
/************************* MODIFIED ATTRIBUTES **************************/
#define MODATTR_NONE 0
#define MODATTR_NOTIFICATIONS_ENABLED 1
#define MODATTR_ACTIVE_CHECKS_ENABLED 2
#define MODATTR_PASSIVE_CHECKS_ENABLED 4
#define MODATTR_EVENT_HANDLER_ENABLED 8
#define MODATTR_FLAP_DETECTION_ENABLED 16
#define MODATTR_FAILURE_PREDICTION_ENABLED 32
#define MODATTR_PERFORMANCE_DATA_ENABLED 64
#define MODATTR_OBSESSIVE_HANDLER_ENABLED 128
#define MODATTR_EVENT_HANDLER_COMMAND 256
#define MODATTR_CHECK_COMMAND 512
#define MODATTR_NORMAL_CHECK_INTERVAL 1024
#define MODATTR_RETRY_CHECK_INTERVAL 2048
#define MODATTR_MAX_CHECK_ATTEMPTS 4096
#define MODATTR_FRESHNESS_CHECKS_ENABLED 8192
#define MODATTR_CHECK_TIMEPERIOD 16384
#define MODATTR_CUSTOM_VARIABLE 32768
#define MODATTR_NOTIFICATION_TIMEPERIOD 65536

177
include/config.h.in Normal file
View File

@ -0,0 +1,177 @@
/* include/config.h.in. Generated from configure.ac by autoheader. */
/* Default Nagios Group */
#undef DEFAULT_NAGIOS_GROUP
/* Default Nagios User */
#undef DEFAULT_NAGIOS_USER
/* Define to 1 if you have the `alarm' function. */
#undef HAVE_ALARM
/* Define to 1 if you have the `bzero' function. */
#undef HAVE_BZERO
/* Define to 1 if you have the `getloadavg' function. */
#undef HAVE_GETLOADAVG
/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
/* Define to 1 if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
/* Define to 1 if you have the <grp.h> header file. */
#undef HAVE_GRP_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#undef HAVE_MALLOC
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define to 1 if you have the <pthread.h> header file. */
#undef HAVE_PTHREAD_H
/* Define to 1 if you have the <pwd.h> header file. */
#undef HAVE_PWD_H
/* Define to 1 if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
/* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET
/* Define to 1 if `stat' has the bug that it succeeds when given the
zero-length file name argument. */
#undef HAVE_STAT_EMPTY_STRING_BUG
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strspn' function. */
#undef HAVE_STRSPN
/* Define to 1 if `d_type' is member of `struct dirent'. */
#undef HAVE_STRUCT_DIRENT_D_TYPE
/* Define to 1 if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_DIR_H
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_NDIR_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H
/* Define to 1 if you have the `vfork' function. */
#undef HAVE_VFORK
/* Define to 1 if you have the <vfork.h> header file. */
#undef HAVE_VFORK_H
/* Define to 1 if `fork' works. */
#undef HAVE_WORKING_FORK
/* Define to 1 if `vfork' works. */
#undef HAVE_WORKING_VFORK
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
/* Define to rpl_malloc if the replacement function should be used. */
#undef malloc
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
/* Define as `fork' if `vfork' does not work. */
#undef vfork

4
include/global.h Normal file
View File

@ -0,0 +1,4 @@
#ifndef GLOBAL_H_
#define GLOBAL_H_
#endif /*GLOBAL_H_*/

43
include/locations.h Normal file
View File

@ -0,0 +1,43 @@
/************************************************************************
*
* Nagios Locations Header File
* Written By: Ethan Galstad (nagios@nagios.org)
* Last Modified: 04-30-2007
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
************************************************************************/
#define DEFAULT_TEMP_FILE "/usr/local/nagios/var/tempfile"
#define DEFAULT_TEMP_PATH "/tmp"
#define DEFAULT_CHECK_RESULT_PATH "/usr/local/nagios/var/spool/checkresults"
#define DEFAULT_STATUS_FILE "/usr/local/nagios/var/status.dat"
#define DEFAULT_LOG_FILE "/usr/local/nagios/var/nagios.log"
#define DEFAULT_LOG_ARCHIVE_PATH "/usr/local/nagios/var/archives/"
#define DEFAULT_DEBUG_FILE "/usr/local/nagios/var/nagios.debug"
#define DEFAULT_COMMENT_FILE "/usr/local/nagios/var/comments.dat"
#define DEFAULT_DOWNTIME_FILE "/usr/local/nagios/var/downtime.dat"
#define DEFAULT_RETENTION_FILE "/usr/local/nagios/var/retention.dat"
#define DEFAULT_COMMAND_FILE "/usr/local/nagios/var/rw/nagios.cmd"
#define DEFAULT_CONFIG_FILE "/usr/local/nagios/etc/nagios.cfg"
#define DEFAULT_PHYSICAL_HTML_PATH "/usr/local/nagios/share"
#define DEFAULT_URL_HTML_PATH "/nagios"
#define DEFAULT_PHYSICAL_CGIBIN_PATH "/usr/local/nagios/sbin"
#define DEFAULT_URL_CGIBIN_PATH "/nagios/cgi-bin"
#define DEFAULT_CGI_CONFIG_FILE "/usr/local/nagios/etc/cgi.cfg"
#define DEFAULT_LOCK_FILE "/usr/local/nagios/var/nagios.lock"
#define DEFAULT_OBJECT_CACHE_FILE "/usr/local/nagios/var/objects.cache"
#define DEFAULT_PRECACHED_OBJECT_FILE "/usr/local/nagios/var/objects.precache"
#define DEFAULT_EVENT_BROKER_FILE "/usr/local/nagios/var/broker.socket"
#define DEFAULT_P1_FILE "/usr/local/nagios/bin/p1.pl" /**** EMBEDDED PERL ****/
#define DEFAULT_AUTH_FILE "" /**** EMBEDDED PERL - IS THIS USED? ****/

812
include/nagios.h Normal file
View File

@ -0,0 +1,812 @@
/************************************************************************
*
* Nagios Main Header File
* Written By: Ethan Galstad (nagios@nagios.org)
* Last Modified: 02-23-2008
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
************************************************************************/
#ifndef _NAGIOS_H
#define _NAGIOS_H
#ifndef __GNUC__
# define __attribute__(x) /* nothing */
#endif
#include "config.h"
//#include "pnp.h"
#include "common.h"
#include "locations.h"
#include "objects.h"
#ifdef __cplusplus
extern "C" {
#endif
/************* MISC LENGTH/SIZE DEFINITIONS ***********/
/*
NOTE: Plugin length is artificially capped at 8k to prevent runaway plugins from returning MBs/GBs of data
back to Nagios. If you increase the 8k cap by modifying this value, make sure you also increase the value
of MAX_EXTERNAL_COMMAND_LENGTH in common.h to allow for passive checks results received through the external
command file. EG 10/19/07
*/
#define MAX_PLUGIN_OUTPUT_LENGTH 8192 /* max length of plugin output (including perf data) */
/******************* DEFAULT VALUES *******************/
#define DEFAULT_LOG_LEVEL 1 /* log all events to main log file */
#define DEFAULT_USE_SYSLOG 1 /* log events to syslog? 1=yes, 0=no */
#define DEFAULT_SYSLOG_LEVEL 2 /* log only severe events to syslog */
#define DEFAULT_NOTIFICATION_LOGGING 1 /* log notification events? 1=yes, 0=no */
#define DEFAULT_INTER_CHECK_DELAY 5.0 /* seconds between initial service check scheduling */
#define DEFAULT_INTERLEAVE_FACTOR 1 /* default interleave to use when scheduling checks */
#define DEFAULT_SLEEP_TIME 0.5 /* seconds between event run checks */
#define DEFAULT_INTERVAL_LENGTH 60 /* seconds per interval unit for check scheduling */
#define DEFAULT_RETRY_INTERVAL 30 /* services are retried in 30 seconds if they're not OK */
#define DEFAULT_COMMAND_CHECK_INTERVAL -1 /* interval to check for external commands (default = as often as possible) */
#define DEFAULT_CHECK_REAPER_INTERVAL 10 /* interval in seconds to reap host and service check results */
#define DEFAULT_MAX_REAPER_TIME 30 /* maximum number of seconds to spend reaping service checks before we break out for a while */
#define DEFAULT_MAX_CHECK_RESULT_AGE 3600 /* maximum number of seconds that a check result file is considered to be valid */
#define DEFAULT_MAX_PARALLEL_SERVICE_CHECKS 0 /* maximum number of service checks we can have running at any given time (0=unlimited) */
#define DEFAULT_RETENTION_UPDATE_INTERVAL 60 /* minutes between auto-save of retention data */
#define DEFAULT_RETENTION_SCHEDULING_HORIZON 900 /* max seconds between program restarts that we will preserve scheduling information */
#define DEFAULT_STATUS_UPDATE_INTERVAL 60 /* seconds between aggregated status data updates */
#define DEFAULT_FRESHNESS_CHECK_INTERVAL 60 /* seconds between service result freshness checks */
#define DEFAULT_AUTO_RESCHEDULING_INTERVAL 30 /* seconds between host and service check rescheduling events */
#define DEFAULT_AUTO_RESCHEDULING_WINDOW 180 /* window of time (in seconds) for which we should reschedule host and service checks */
#define DEFAULT_ORPHAN_CHECK_INTERVAL 60 /* seconds between checks for orphaned hosts and services */
#define DEFAULT_NOTIFICATION_TIMEOUT 30 /* max time in seconds to wait for notification commands to complete */
#define DEFAULT_EVENT_HANDLER_TIMEOUT 30 /* max time in seconds to wait for event handler commands to complete */
#define DEFAULT_HOST_CHECK_TIMEOUT 30 /* max time in seconds to wait for host check commands to complete */
#define DEFAULT_SERVICE_CHECK_TIMEOUT 60 /* max time in seconds to wait for service check commands to complete */
#define DEFAULT_OCSP_TIMEOUT 15 /* max time in seconds to wait for obsessive compulsive processing commands to complete */
#define DEFAULT_OCHP_TIMEOUT 15 /* max time in seconds to wait for obsessive compulsive processing commands to complete */
#define DEFAULT_PERFDATA_TIMEOUT 5 /* max time in seconds to wait for performance data commands to complete */
#define DEFAULT_TIME_CHANGE_THRESHOLD 900 /* compensate for time changes of more than 15 minutes */
#define DEFAULT_LOG_HOST_RETRIES 0 /* don't log host retries */
#define DEFAULT_LOG_SERVICE_RETRIES 0 /* don't log service retries */
#define DEFAULT_LOG_EVENT_HANDLERS 1 /* log event handlers */
#define DEFAULT_LOG_INITIAL_STATES 0 /* don't log initial service and host states */
#define DEFAULT_LOG_EXTERNAL_COMMANDS 1 /* log external commands */
#define DEFAULT_LOG_PASSIVE_CHECKS 1 /* log passive service checks */
#define DEFAULT_DEBUG_LEVEL 0 /* don't log any debugging information */
#define DEFAULT_DEBUG_VERBOSITY 1
#define DEFAULT_MAX_DEBUG_FILE_SIZE 1000000 /* max size of debug log */
#define DEFAULT_AGGRESSIVE_HOST_CHECKING 0 /* don't use "aggressive" host checking */
#define DEFAULT_CHECK_EXTERNAL_COMMANDS 1 /* check for external commands */
#define DEFAULT_CHECK_ORPHANED_SERVICES 1 /* check for orphaned services */
#define DEFAULT_CHECK_ORPHANED_HOSTS 1 /* check for orphaned hosts */
#define DEFAULT_ENABLE_FLAP_DETECTION 0 /* don't enable flap detection */
#define DEFAULT_PROCESS_PERFORMANCE_DATA 0 /* don't process performance data */
#define DEFAULT_CHECK_SERVICE_FRESHNESS 1 /* check service result freshness */
#define DEFAULT_CHECK_HOST_FRESHNESS 0 /* don't check host result freshness */
#define DEFAULT_AUTO_RESCHEDULE_CHECKS 0 /* don't auto-reschedule host and service checks */
#define DEFAULT_TRANSLATE_PASSIVE_HOST_CHECKS 0 /* should we translate DOWN/UNREACHABLE passive host checks? */
#define DEFAULT_PASSIVE_HOST_CHECKS_SOFT 0 /* passive host checks are treated as HARD by default */
#define DEFAULT_LOW_SERVICE_FLAP_THRESHOLD 20.0 /* low threshold for detection of service flapping */
#define DEFAULT_HIGH_SERVICE_FLAP_THRESHOLD 30.0 /* high threshold for detection of service flapping */
#define DEFAULT_LOW_HOST_FLAP_THRESHOLD 20.0 /* low threshold for detection of host flapping */
#define DEFAULT_HIGH_HOST_FLAP_THRESHOLD 30.0 /* high threshold for detection of host flapping */
#define DEFAULT_HOST_CHECK_SPREAD 30 /* max minutes to schedule all initial host checks */
#define DEFAULT_SERVICE_CHECK_SPREAD 30 /* max minutes to schedule all initial service checks */
#define DEFAULT_CACHED_HOST_CHECK_HORIZON 15 /* max age in seconds that cached host checks can be used */
#define DEFAULT_CACHED_SERVICE_CHECK_HORIZON 15 /* max age in seconds that cached service checks can be used */
#define DEFAULT_ENABLE_PREDICTIVE_HOST_DEPENDENCY_CHECKS 1 /* should we use predictive host dependency checks? */
#define DEFAULT_ENABLE_PREDICTIVE_SERVICE_DEPENDENCY_CHECKS 1 /* should we use predictive service dependency checks? */
#define DEFAULT_USE_LARGE_INSTALLATION_TWEAKS 0 /* don't use tweaks for large Nagios installations */
#define DEFAULT_ENABLE_EMBEDDED_PERL 1 /* enable embedded Perl interpreter (if compiled in) */
#define DEFAULT_USE_EMBEDDED_PERL_IMPLICITLY 1 /* by default, embedded Perl is used for Perl plugins that don't explicitly disable it */
#define DEFAULT_ADDITIONAL_FRESHNESS_LATENCY 15 /* seconds to be added to freshness thresholds when automatically calculated by Nagios */
/******************* LOGGING TYPES ********************/
#define NSLOG_RUNTIME_ERROR 1
#define NSLOG_RUNTIME_WARNING 2
#define NSLOG_VERIFICATION_ERROR 4
#define NSLOG_VERIFICATION_WARNING 8
#define NSLOG_CONFIG_ERROR 16
#define NSLOG_CONFIG_WARNING 32
#define NSLOG_PROCESS_INFO 64
#define NSLOG_EVENT_HANDLER 128
/*#define NSLOG_NOTIFICATION 256*/ /* NOT USED ANYMORE - CAN BE REUSED */
#define NSLOG_EXTERNAL_COMMAND 512
#define NSLOG_HOST_UP 1024
#define NSLOG_HOST_DOWN 2048
#define NSLOG_HOST_UNREACHABLE 4096
#define NSLOG_SERVICE_OK 8192
#define NSLOG_SERVICE_UNKNOWN 16384
#define NSLOG_SERVICE_WARNING 32768
#define NSLOG_SERVICE_CRITICAL 65536
#define NSLOG_PASSIVE_CHECK 131072
#define NSLOG_INFO_MESSAGE 262144
#define NSLOG_HOST_NOTIFICATION 524288
#define NSLOG_SERVICE_NOTIFICATION 1048576
/***************** DEBUGGING LEVELS *******************/
#define DEBUGL_ALL -1
#define DEBUGL_NONE 0
#define DEBUGL_FUNCTIONS 1
#define DEBUGL_CONFIG 2
#define DEBUGL_PROCESS 4
#define DEBUGL_STATUSDATA 4
#define DEBUGL_RETENTIONDATA 4
#define DEBUGL_EVENTS 8
#define DEBUGL_CHECKS 16
#define DEBUGL_IPC 16
#define DEBUGL_FLAPPING 16
#define DEBUGL_EVENTHANDLERS 16
#define DEBUGL_PERFDATA 16
#define DEBUGL_NOTIFICATIONS 32
#define DEBUGL_EVENTBROKER 64
#define DEBUGL_EXTERNALCOMMANDS 128
#define DEBUGL_COMMANDS 256
#define DEBUGL_DOWNTIME 512
#define DEBUGL_COMMENTS 1024
#define DEBUGL_MACROS 2048
#define DEBUGV_BASIC 0
#define DEBUGV_MORE 1
#define DEBUGV_MOST 2
/******************** HOST STATUS *********************/
#define HOST_UP 0
#define HOST_DOWN 1
#define HOST_UNREACHABLE 2
/******************* STATE LOGGING TYPES **************/
#define INITIAL_STATES 1
#define CURRENT_STATES 2
/************ SERVICE DEPENDENCY VALUES ***************/
#define DEPENDENCIES_OK 0
#define DEPENDENCIES_FAILED 1
/*********** ROUTE CHECK PROPAGATION TYPES ************/
#define PROPAGATE_TO_PARENT_HOSTS 1
#define PROPAGATE_TO_CHILD_HOSTS 2
/****************** SERVICE STATES ********************/
#define STATE_OK 0
#define STATE_WARNING 1
#define STATE_CRITICAL 2
#define STATE_UNKNOWN 3 /* changed from -1 on 02/24/2001 */
/****************** FLAPPING TYPES ********************/
#define HOST_FLAPPING 0
#define SERVICE_FLAPPING 1
/**************** NOTIFICATION TYPES ******************/
#define HOST_NOTIFICATION 0
#define SERVICE_NOTIFICATION 1
/************* NOTIFICATION REASON TYPES ***************/
#define NOTIFICATION_NORMAL 0
#define NOTIFICATION_ACKNOWLEDGEMENT 1
#define NOTIFICATION_FLAPPINGSTART 2
#define NOTIFICATION_FLAPPINGSTOP 3
#define NOTIFICATION_FLAPPINGDISABLED 4
#define NOTIFICATION_DOWNTIMESTART 5
#define NOTIFICATION_DOWNTIMEEND 6
#define NOTIFICATION_DOWNTIMECANCELLED 7
#define NOTIFICATION_CUSTOM 99
/**************** EVENT HANDLER TYPES *****************/
#define HOST_EVENTHANDLER 0
#define SERVICE_EVENTHANDLER 1
#define GLOBAL_HOST_EVENTHANDLER 2
#define GLOBAL_SERVICE_EVENTHANDLER 3
/***************** STATE CHANGE TYPES *****************/
#define HOST_STATECHANGE 0
#define SERVICE_STATECHANGE 1
/***************** OBJECT CHECK TYPES *****************/
#define SERVICE_CHECK 0
#define HOST_CHECK 1
/******************* EVENT TYPES **********************/
#define EVENT_SERVICE_CHECK 0 /* active service check */
#define EVENT_COMMAND_CHECK 1 /* external command check */
#define EVENT_LOG_ROTATION 2 /* log file rotation */
#define EVENT_PROGRAM_SHUTDOWN 3 /* program shutdown */
#define EVENT_PROGRAM_RESTART 4 /* program restart */
#define EVENT_CHECK_REAPER 5 /* reaps results from host and service checks */
#define EVENT_ORPHAN_CHECK 6 /* checks for orphaned hosts and services */
#define EVENT_RETENTION_SAVE 7 /* save (dump) retention data */
#define EVENT_STATUS_SAVE 8 /* save (dump) status data */
#define EVENT_SCHEDULED_DOWNTIME 9 /* scheduled host or service downtime */
#define EVENT_SFRESHNESS_CHECK 10 /* checks service result "freshness" */
#define EVENT_EXPIRE_DOWNTIME 11 /* checks for (and removes) expired scheduled downtime */
#define EVENT_HOST_CHECK 12 /* active host check */
#define EVENT_HFRESHNESS_CHECK 13 /* checks host result "freshness" */
#define EVENT_RESCHEDULE_CHECKS 14 /* adjust scheduling of host and service checks */
#define EVENT_EXPIRE_COMMENT 15 /* removes expired comments */
#define EVENT_SLEEP 98 /* asynchronous sleep event that occurs when event queues are empty */
#define EVENT_USER_FUNCTION 99 /* USER-defined function (modules) */
/******* INTER-CHECK DELAY CALCULATION TYPES **********/
#define ICD_NONE 0 /* no inter-check delay */
#define ICD_DUMB 1 /* dumb delay of 1 second */
#define ICD_SMART 2 /* smart delay */
#define ICD_USER 3 /* user-specified delay */
/******* INTERLEAVE FACTOR CALCULATION TYPES **********/
#define ILF_USER 0 /* user-specified interleave factor */
#define ILF_SMART 1 /* smart interleave */
/************ SCHEDULED DOWNTIME TYPES ****************/
#define ACTIVE_DOWNTIME 0 /* active downtime - currently in effect */
#define PENDING_DOWNTIME 1 /* pending downtime - scheduled for the future */
/****************** DATA STRUCTURES *******************/
/* TIMED_EVENT structure */
typedef struct timed_event_struct{
int event_type;
time_t run_time;
int recurring;
unsigned long event_interval;
int compensate_for_time_change;
void *timing_func;
void *event_data;
void *event_args;
int event_options;
struct timed_event_struct *next;
struct timed_event_struct *prev;
}timed_event;
/* NOTIFY_LIST structure */
typedef struct notify_list_struct{
contact *contact;
struct notify_list_struct *next;
}notification;
/* CHECK_RESULT structure */
typedef struct check_result_struct{
int object_check_type; /* is this a service or a host check? */
char *host_name; /* host name */
char *service_description; /* service description */
int check_type; /* was this an active or passive service check? */
int check_options;
int scheduled_check; /* was this a scheduled or an on-demand check? */
int reschedule_check; /* should we reschedule the next check */
char *output_file; /* what file is the output stored in? */
FILE *output_file_fp;
int output_file_fd;
double latency;
struct timeval start_time; /* time the service check was initiated */
struct timeval finish_time; /* time the service check was completed */
int early_timeout; /* did the service check timeout? */
int exited_ok; /* did the plugin check return okay? */
int return_code; /* plugin return code */
char *output; /* plugin output */
struct check_result_struct *next;
}check_result;
/* SCHED_INFO structure */
typedef struct sched_info_struct{
int total_services;
int total_scheduled_services;
int total_hosts;
int total_scheduled_hosts;
double average_services_per_host;
double average_scheduled_services_per_host;
unsigned long service_check_interval_total;
unsigned long host_check_interval_total;
double average_service_execution_time;
double average_service_check_interval;
double average_host_check_interval;
double average_service_inter_check_delay;
double average_host_inter_check_delay;
double service_inter_check_delay;
double host_inter_check_delay;
int service_interleave_factor;
int max_service_check_spread;
int max_host_check_spread;
time_t first_service_check;
time_t last_service_check;
time_t first_host_check;
time_t last_host_check;
}sched_info;
/* PASSIVE_CHECK_RESULT structure */
typedef struct passive_check_result_struct{
int object_check_type;
char *host_name;
char *service_description;
int return_code;
char *output;
time_t check_time;
double latency;
struct passive_check_result_struct *next;
}passive_check_result;
/* CIRCULAR_BUFFER structure - used by worker threads */
typedef struct circular_buffer_struct{
void **buffer;
int tail;
int head;
int items;
int high; /* highest number of items that has ever been stored in buffer */
unsigned long overflow;
pthread_mutex_t buffer_lock;
}circular_buffer;
/* MMAPFILE structure - used for reading files via mmap() */
typedef struct mmapfile_struct{
char *path;
int mode;
int fd;
unsigned long file_size;
unsigned long current_position;
unsigned long current_line;
void *mmap_buf;
}mmapfile;
/* DBUF structure - dynamic string storage */
typedef struct dbuf_struct{
char *buf;
unsigned long used_size;
unsigned long allocated_size;
unsigned long chunk_size;
}dbuf;
#define CHECK_STATS_BUCKETS 15
/* used for tracking host and service check statistics */
typedef struct check_stats_struct{
int current_bucket;
int bucket[CHECK_STATS_BUCKETS];
int overflow_bucket;
int minute_stats[3];
time_t last_update;
}check_stats;
/******************* THREAD STUFF ********************/
/* slots in circular buffers */
#define DEFAULT_EXTERNAL_COMMAND_BUFFER_SLOTS 4096
/* worker threads */
#define TOTAL_WORKER_THREADS 1
#define COMMAND_WORKER_THREAD 0
/******************** FUNCTIONS **********************/
/**** Configuration Functions ****/
int read_main_config_file(char *); /* reads the main config file (nagios.cfg) */
int read_resource_file(char *); /* processes macros in resource file */
int read_all_object_data(char *); /* reads all object config data */
/**** Setup Functions ****/
int pre_flight_check(void); /* try and verify the configuration data */
int pre_flight_object_check(int *,int *); /* verify object relationships and settings */
int pre_flight_circular_check(int *,int *); /* detects circular dependencies and paths */
void init_timing_loop(void); /* setup the initial scheduling queue */
void setup_sighandler(void); /* trap signals */
void reset_sighandler(void); /* reset signals to default action */
int daemon_init(void); /* switches to daemon mode */
int drop_privileges(char *,char *); /* drops privileges before startup */
void display_scheduling_info(void); /* displays service check scheduling information */
/**** Event Queue Functions ****/
int schedule_new_event(int,int,time_t,int,unsigned long,void *,int,void *,void *,int); /* schedules a new timed event */
void reschedule_event(timed_event *,timed_event **,timed_event **); /* reschedules an event */
void add_event(timed_event *,timed_event **,timed_event **); /* adds an event to the execution queue */
void remove_event(timed_event *,timed_event **,timed_event **); /* remove an event from the execution queue */
int event_execution_loop(void); /* main monitoring/event handler loop */
int handle_timed_event(timed_event *); /* top level handler for timed events */
void adjust_check_scheduling(void); /* auto-adjusts scheduling of host and service checks */
void compensate_for_system_time_change(unsigned long,unsigned long); /* attempts to compensate for a change in the system time */
void adjust_timestamp_for_time_change(time_t,time_t,unsigned long,time_t *); /* adjusts a timestamp variable for a system time change */
void resort_event_list(timed_event **,timed_event **); /* resorts event list by event run time for system time changes */
/**** IPC Functions ****/
int move_check_result_to_queue(char *);
int process_check_result_queue(char *);
int process_check_result_file(char *);
int add_check_result_to_list(check_result *);
check_result *read_check_result(void); /* reads a host/service check result from the list in memory */
int delete_check_result_file(char *);
int free_check_result_list(void);
int init_check_result(check_result *);
int free_check_result(check_result *); /* frees memory associated with a host/service check result */
int parse_check_output(char *,char **,char **,char **,int,int);
int open_command_file(void); /* creates the external command file as a named pipe (FIFO) and opens it for reading */
int close_command_file(void); /* closes and deletes the external command file (FIFO) */
/**** Monitoring/Event Handler Functions ****/
int check_service_dependencies(service *,int); /* checks service dependencies */
int check_host_dependencies(host *,int); /* checks host dependencies */
void check_for_orphaned_services(void); /* checks for orphaned services */
void check_for_orphaned_hosts(void); /* checks for orphaned hosts */
void check_service_result_freshness(void); /* checks the "freshness" of service check results */
int is_service_result_fresh(service *,time_t,int); /* determines if a service's check results are fresh */
void check_host_result_freshness(void); /* checks the "freshness" of host check results */
int is_host_result_fresh(host *,time_t,int); /* determines if a host's check results are fresh */
int my_system(char *,int,int *,double *,char **,int); /* executes a command via popen(), but also protects against timeouts */
/**** Flap Detection Functions ****/
void check_for_service_flapping(service *,int,int); /* determines whether or not a service is "flapping" between states */
void check_for_host_flapping(host *,int,int,int); /* determines whether or not a host is "flapping" between states */
void set_service_flap(service *,double,double,double,int); /* handles a service that is flapping */
void clear_service_flap(service *,double,double,double); /* handles a service that has stopped flapping */
void set_host_flap(host *,double,double,double,int); /* handles a host that is flapping */
void clear_host_flap(host *,double,double,double); /* handles a host that has stopped flapping */
void enable_flap_detection_routines(void); /* enables flap detection on a program-wide basis */
void disable_flap_detection_routines(void); /* disables flap detection on a program-wide basis */
void enable_host_flap_detection(host *); /* enables flap detection for a particular host */
void disable_host_flap_detection(host *); /* disables flap detection for a particular host */
void enable_service_flap_detection(service *); /* enables flap detection for a particular service */
void disable_service_flap_detection(service *); /* disables flap detection for a particular service */
void handle_host_flap_detection_disabled(host *); /* handles the details when flap detection is disabled globally or on a per-host basis */
void handle_service_flap_detection_disabled(service *); /* handles the details when flap detection is disabled globally or on a per-service basis */
/**** Route/Host Check Functions ****/
int perform_on_demand_host_check(host *,int *,int,int,unsigned long);
int perform_scheduled_host_check(host *,int,double);
int check_host_check_viability_3x(host *,int,int *,time_t *);
int adjust_host_check_attempt_3x(host *,int);
int determine_host_reachability(host *);
int process_host_check_result_3x(host *,int,char *,int,int,int,unsigned long);
int perform_on_demand_host_check_3x(host *,int *,int,int,unsigned long);
int run_sync_host_check_3x(host *,int *,int,int,unsigned long);
int execute_sync_host_check_3x(host *);
int run_scheduled_host_check_3x(host *,int,double);
int run_async_host_check_3x(host *,int,double,int,int,int *,time_t *);
int handle_async_host_check_result_3x(host *,check_result *);
/**** Service Check Functions ****/
int check_service_check_viability(service *,int,int *,time_t *);
int run_scheduled_service_check(service *,int,double);
int run_async_service_check(service *,int,double,int,int,int *,time_t *);
int handle_async_service_check_result(service *,check_result *);
/**** Event Handler Functions ****/
int handle_host_state(host *); /* top level host state handler */
/**** Common Check Fucntions *****/
int reap_check_results(void);
/**** Check Statistics Functions ****/
int init_check_stats(void);
int update_check_stats(int,time_t);
int generate_check_stats(void);
/**** Event Handler Functions ****/
int obsessive_compulsive_service_check_processor(service *); /* distributed monitoring craziness... */
int obsessive_compulsive_host_check_processor(host *); /* distributed monitoring craziness... */
int handle_service_event(service *); /* top level service event logic */
int run_service_event_handler(service *); /* runs the event handler for a specific service */
int run_global_service_event_handler(service *); /* runs the global service event handler */
int handle_host_event(host *); /* top level host event logic */
int run_host_event_handler(host *); /* runs the event handler for a specific host */
int run_global_host_event_handler(host *); /* runs the global host event handler */
/**** Notification Functions ****/
int check_service_notification_viability(service *,int,int); /* checks viability of notifying all contacts about a service */
int is_valid_escalation_for_service_notification(service *,serviceescalation *,int); /* checks if an escalation entry is valid for a particular service notification */
int should_service_notification_be_escalated(service *); /* checks if a service notification should be escalated */
int service_notification(service *,int,char *,char *,int); /* notify all contacts about a service (problem or recovery) */
int check_contact_service_notification_viability(contact *,service *,int,int); /* checks viability of notifying a contact about a service */
int notify_contact_of_service(contact *,service *,int,char *,char *,int,int); /* notify a single contact about a service */
int check_host_notification_viability(host *,int,int); /* checks viability of notifying all contacts about a host */
int is_valid_escalation_for_host_notification(host *,hostescalation *,int); /* checks if an escalation entry is valid for a particular host notification */
int should_host_notification_be_escalated(host *); /* checks if a host notification should be escalated */
int host_notification(host *,int,char *,char *,int); /* notify all contacts about a host (problem or recovery) */
int check_contact_host_notification_viability(contact *,host *,int,int); /* checks viability of notifying a contact about a host */
int notify_contact_of_host(contact *,host *,int,char *,char *,int,int); /* notify a single contact about a host */
int create_notification_list_from_host(host *,int,int *); /* given a host, create list of contacts to be notified (remove duplicates) */
int create_notification_list_from_service(service *,int,int *); /* given a service, create list of contacts to be notified (remove duplicates) */
int add_notification(contact *); /* adds a notification instance */
notification *find_notification(contact *); /* finds a notification object */
time_t get_next_host_notification_time(host *,time_t); /* calculates nex acceptable re-notification time for a host */
time_t get_next_service_notification_time(service *,time_t); /* calculates nex acceptable re-notification time for a service */
/**** Logging Functions ****/
void logit(int,int,const char *, ...)
__attribute__((__format__(__printf__, 3, 4)));
int write_to_logs_and_console(char *,unsigned long,int); /* writes a string to screen and logs */
int write_to_console(char *); /* writes a string to screen */
int write_to_all_logs(char *,unsigned long); /* writes a string to main log file and syslog facility */
int write_to_all_logs_with_timestamp(char *,unsigned long,time_t *); /* writes a string to main log file and syslog facility */
int write_to_log(char *,unsigned long,time_t *); /* write a string to the main log file */
int write_to_syslog(char *,unsigned long); /* write a string to the syslog facility */
int log_service_event(service *); /* logs a service event */
int log_host_event(host *); /* logs a host event */
int log_host_states(int,time_t *); /* logs initial/current host states */
int log_service_states(int,time_t *); /* logs initial/current service states */
int rotate_log_file(time_t); /* rotates the main log file */
int write_log_file_info(time_t *); /* records log file/version info */
int open_debug_log(void);
int log_debug_info(int,int,const char *,...)
__attribute__((__format__(__printf__, 3, 4)));
int close_debug_log(void);
/**** Cleanup Functions ****/
void cleanup(void); /* cleanup after ourselves (before quitting or restarting) */
void free_memory(void); /* free memory allocated to all linked lists in memory */
int reset_variables(void); /* reset all global variables */
void free_notification_list(void); /* frees all memory allocated to the notification list */
/**** Hash Functions ****/
int hashfunc(const char *name1, const char *name2, int hashslots);
int compare_hashdata(const char *,const char *,const char *,const char *);
/**** Miscellaneous Functions ****/
void sighandler(int); /* handles signals */
void service_check_sighandler(int); /* handles timeouts when executing service checks */
void host_check_sighandler(int); /* handles timeouts when executing host checks */
void my_system_sighandler(int); /* handles timeouts when executing commands via my_system() */
void file_lock_sighandler(int); /* handles timeouts while waiting for file locks */
void strip(char *); /* strips whitespace from string */
char *my_strtok(char *,char *); /* my replacement for strtok() function (doesn't skip consecutive tokens) */
char *my_strsep(char **,const char *); /* Solaris doesn't have strsep(), so I took this from the glibc source code */
#ifdef REMOVED_10182007
int my_free(void **); /* my wrapper for free() */
#endif
int compare_strings(char *,char *); /* compares two strings for equality */
char *escape_newlines(char *);
int contains_illegal_object_chars(char *); /* tests whether or not an object name (host, service, etc.) contains illegal characters */
int my_rename(char *,char *); /* renames a file - works across filesystems */
int my_fcopy(char *,char *); /* copies a file - works across filesystems */
int get_raw_command_line(command *,char *,char **,int); /* given a raw command line, determine the actual command to run */
int check_time_against_period(time_t,timeperiod *); /* check to see if a specific time is covered by a time period */
int is_daterange_single_day(daterange *);
time_t calculate_time_from_weekday_of_month(int,int,int,int); /* calculates midnight time of specific (3rd, last, etc.) weekday of a particular month */
time_t calculate_time_from_day_of_month(int,int,int); /* calculates midnight time of specific (1st, last, etc.) day of a particular month */
void get_next_valid_time(time_t, time_t *,timeperiod *); /* get the next valid time in a time period */
void get_datetime_string(time_t *,char *,int,int); /* get a date/time string for use in output */
void get_time_breakdown(unsigned long,int *,int *,int *, int *);
time_t get_next_log_rotation_time(void); /* determine the next time to schedule a log rotation */
int init_embedded_perl(char **); /* initialized embedded perl interpreter */
int deinit_embedded_perl(void); /* cleans up embedded perl */
int file_uses_embedded_perl(char *); /* tests whether or not the embedded perl interpreter should be used on a file */
int dbuf_init(dbuf *,int);
int dbuf_free(dbuf *);
int dbuf_strcat(dbuf *,char *);
int set_environment_var(char *,char *,int); /* sets/clears and environment variable */
/**** External Command Functions ****/
int check_for_external_commands(void); /* checks for any external commands */
int process_external_command1(char *); /* top-level external command processor */
int process_external_command2(int,time_t,char *); /* process an external command */
int process_external_commands_from_file(char *,int); /* process external commands in a file */
int process_host_command(int,time_t,char *); /* process an external host command */
int process_hostgroup_command(int,time_t,char *); /* process an external hostgroup command */
int process_service_command(int,time_t,char *); /* process an external service command */
int process_servicegroup_command(int,time_t,char *); /* process an external servicegroup command */
int process_contact_command(int,time_t,char *); /* process an external contact command */
int process_contactgroup_command(int,time_t,char *); /* process an external contactgroup command */
/**** External Command Implementations ****/
int cmd_add_comment(int,time_t,char *); /* add a service or host comment */
int cmd_delete_comment(int,char *); /* delete a service or host comment */
int cmd_delete_all_comments(int,char *); /* delete all comments associated with a host or service */
int cmd_delay_notification(int,char *); /* delay a service or host notification */
int cmd_schedule_service_check(int,char *,int); /* schedule an immediate or delayed service check */
int cmd_schedule_check(int,char *); /* schedule an immediate or delayed host check */
int cmd_schedule_host_service_checks(int,char *,int); /* schedule an immediate or delayed checks of all services on a host */
int cmd_signal_process(int,char *); /* schedules a program shutdown or restart */
int cmd_process_service_check_result(int,time_t,char *); /* processes a passive service check */
int cmd_process_host_check_result(int,time_t,char *); /* processes a passive host check */
int cmd_acknowledge_problem(int,char *); /* acknowledges a host or service problem */
int cmd_remove_acknowledgement(int,char *); /* removes a host or service acknowledgement */
int cmd_schedule_downtime(int,time_t,char *); /* schedules host or service downtime */
int cmd_delete_downtime(int,char *); /* cancels active/pending host or service scheduled downtime */
int cmd_change_object_int_var(int,char *); /* changes host/svc (int) variable */
int cmd_change_object_char_var(int,char *); /* changes host/svc (char) variable */
int cmd_change_object_custom_var(int,char *); /* changes host/svc custom variable */
int cmd_process_external_commands_from_file(int,char *); /* process external commands from a file */
int process_passive_service_check(time_t,char *,char *,int,char *);
int process_passive_host_check(time_t,char *,int,char *);
/**** Internal Command Implementations ****/
void disable_service_checks(service *); /* disables a service check */
void enable_service_checks(service *); /* enables a service check */
void schedule_service_check(service *,time_t,int); /* schedules an immediate or delayed service check */
void schedule_host_check(host *,time_t,int); /* schedules an immediate or delayed host check */
void enable_all_notifications(void); /* enables notifications on a program-wide basis */
void disable_all_notifications(void); /* disables notifications on a program-wide basis */
void enable_service_notifications(service *); /* enables service notifications */
void disable_service_notifications(service *); /* disables service notifications */
void enable_host_notifications(host *); /* enables host notifications */
void disable_host_notifications(host *); /* disables host notifications */
void enable_and_propagate_notifications(host *,int,int,int,int); /* enables notifications for all hosts and services beyond a given host */
void disable_and_propagate_notifications(host *,int,int,int,int); /* disables notifications for all hosts and services beyond a given host */
void schedule_and_propagate_downtime(host *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long); /* schedules downtime for all hosts beyond a given host */
void acknowledge_host_problem(host *,char *,char *,int,int,int); /* acknowledges a host problem */
void acknowledge_service_problem(service *,char *,char *,int,int,int); /* acknowledges a service problem */
void remove_host_acknowledgement(host *); /* removes a host acknowledgement */
void remove_service_acknowledgement(service *); /* removes a service acknowledgement */
void start_executing_service_checks(void); /* starts executing service checks */
void stop_executing_service_checks(void); /* stops executing service checks */
void start_accepting_passive_service_checks(void); /* starts accepting passive service check results */
void stop_accepting_passive_service_checks(void); /* stops accepting passive service check results */
void enable_passive_service_checks(service *); /* enables passive service checks for a particular service */
void disable_passive_service_checks(service *); /* disables passive service checks for a particular service */
void start_using_event_handlers(void); /* enables event handlers on a program-wide basis */
void stop_using_event_handlers(void); /* disables event handlers on a program-wide basis */
void enable_service_event_handler(service *); /* enables the event handler for a particular service */
void disable_service_event_handler(service *); /* disables the event handler for a particular service */
void enable_host_event_handler(host *); /* enables the event handler for a particular host */
void disable_host_event_handler(host *); /* disables the event handler for a particular host */
void enable_host_checks(host *); /* enables checks of a particular host */
void disable_host_checks(host *); /* disables checks of a particular host */
void start_obsessing_over_service_checks(void); /* start obsessing about service check results */
void stop_obsessing_over_service_checks(void); /* stop obsessing about service check results */
void start_obsessing_over_host_checks(void); /* start obsessing about host check results */
void stop_obsessing_over_host_checks(void); /* stop obsessing about host check results */
void enable_service_freshness_checks(void); /* enable service freshness checks */
void disable_service_freshness_checks(void); /* disable service freshness checks */
void enable_host_freshness_checks(void); /* enable host freshness checks */
void disable_host_freshness_checks(void); /* disable host freshness checks */
void process_passive_checks(void); /* processes passive host and service check results */
void enable_all_failure_prediction(void); /* enables failure prediction on a program-wide basis */
void disable_all_failure_prediction(void); /* disables failure prediction on a program-wide basis */
void enable_performance_data(void); /* enables processing of performance data on a program-wide basis */
void disable_performance_data(void); /* disables processing of performance data on a program-wide basis */
void start_executing_host_checks(void); /* starts executing host checks */
void stop_executing_host_checks(void); /* stops executing host checks */
void start_accepting_passive_host_checks(void); /* starts accepting passive host check results */
void stop_accepting_passive_host_checks(void); /* stops accepting passive host check results */
void enable_passive_host_checks(host *); /* enables passive host checks for a particular host */
void disable_passive_host_checks(host *); /* disables passive host checks for a particular host */
void start_obsessing_over_service(service *); /* start obsessing about specific service check results */
void stop_obsessing_over_service(service *); /* stop obsessing about specific service check results */
void start_obsessing_over_host(host *); /* start obsessing about specific host check results */
void stop_obsessing_over_host(host *); /* stop obsessing about specific host check results */
void set_host_notification_number(host *,int); /* sets current notification number for a specific host */
void set_service_notification_number(service *,int); /* sets current notification number for a specific service */
void enable_contact_host_notifications(contact *); /* enables host notifications for a specific contact */
void disable_contact_host_notifications(contact *); /* disables host notifications for a specific contact */
void enable_contact_service_notifications(contact *); /* enables service notifications for a specific contact */
void disable_contact_service_notifications(contact *); /* disables service notifications for a specific contact */
int init_check_result_worker_thread(void);
int shutdown_check_result_worker_thread(void);
void * check_result_worker_thread(void *);
void cleanup_check_result_worker_thread(void *);
int init_command_file_worker_thread(void);
int shutdown_command_file_worker_thread(void);
void * command_file_worker_thread(void *);
void cleanup_command_file_worker_thread(void *);
int submit_external_command(char *,int *);
int submit_raw_external_command(char *,time_t *,int *);
char *get_program_version(void);
char *get_program_modification_date(void);
mmapfile *mmap_fopen(char *); /* open a file read-only via mmap() */
int mmap_fclose(mmapfile *);
char *mmap_fgets(mmapfile *);
char *mmap_fgets_multiline(mmapfile *);
#ifdef __cplusplus
}
#endif
#endif

88
include/nebcallbacks.h Normal file
View File

@ -0,0 +1,88 @@
/*****************************************************************************
*
* NEBCALLBACKS.H - Include file for event broker modules
*
* Copyright (c) 2002-2007 Ethan Galstad (nagios@nagios.org)
* Last Modified: 01-06-2007
*
* License:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*****************************************************************************/
#ifndef _NEBCALLBACKS_H
#define _NEBCALLBACKS_H
#include "config.h"
#include "nebmodules.h"
#ifdef __cplusplus
extern "C" {
#endif
/***** CALLBACK TYPES *****/
#define NEBCALLBACK_NUMITEMS 33 /* total number of callback types we have */
#define NEBCALLBACK_RESERVED0 0 /* reserved for future use */
#define NEBCALLBACK_RESERVED1 1
#define NEBCALLBACK_RESERVED2 2
#define NEBCALLBACK_RESERVED3 3
#define NEBCALLBACK_RESERVED4 4
#define NEBCALLBACK_RAW_DATA 5
#define NEBCALLBACK_NEB_DATA 6
#define NEBCALLBACK_PROCESS_DATA 7
#define NEBCALLBACK_TIMED_EVENT_DATA 8
#define NEBCALLBACK_LOG_DATA 9
#define NEBCALLBACK_SYSTEM_COMMAND_DATA 10
#define NEBCALLBACK_EVENT_HANDLER_DATA 11
#define NEBCALLBACK_NOTIFICATION_DATA 12
#define NEBCALLBACK_SERVICE_CHECK_DATA 13
#define NEBCALLBACK_HOST_CHECK_DATA 14
#define NEBCALLBACK_COMMENT_DATA 15
#define NEBCALLBACK_DOWNTIME_DATA 16
#define NEBCALLBACK_FLAPPING_DATA 17
#define NEBCALLBACK_PROGRAM_STATUS_DATA 18
#define NEBCALLBACK_HOST_STATUS_DATA 19
#define NEBCALLBACK_SERVICE_STATUS_DATA 20
#define NEBCALLBACK_ADAPTIVE_PROGRAM_DATA 21
#define NEBCALLBACK_ADAPTIVE_HOST_DATA 22
#define NEBCALLBACK_ADAPTIVE_SERVICE_DATA 23
#define NEBCALLBACK_EXTERNAL_COMMAND_DATA 24
#define NEBCALLBACK_AGGREGATED_STATUS_DATA 25
#define NEBCALLBACK_RETENTION_DATA 26
#define NEBCALLBACK_CONTACT_NOTIFICATION_DATA 27
#define NEBCALLBACK_CONTACT_NOTIFICATION_METHOD_DATA 28
#define NEBCALLBACK_ACKNOWLEDGEMENT_DATA 29
#define NEBCALLBACK_STATE_CHANGE_DATA 30
#define NEBCALLBACK_CONTACT_STATUS_DATA 31
#define NEBCALLBACK_ADAPTIVE_CONTACT_DATA 32
/***** CALLBACK FUNCTIONS *****/
int neb_register_callback(int callback_type, void *mod_handle, int priority, int (*callback_func)(int,void *));
int neb_deregister_callback(int callback_type, int (*callback_func)(int,void *));
int neb_deregister_module_callbacks(nebmodule *);
#ifdef __cplusplus
}
#endif
#endif

102
include/nebmodules.h Normal file
View File

@ -0,0 +1,102 @@
/*****************************************************************************
*
* NEBMODULES.H - Include file for event broker modules
*
* Copyright (c) 2002-2006 Ethan Galstad (nagios@nagios.org)
* Last Modified: 02-27-2006
*
* License:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*****************************************************************************/
#ifndef _NEBMODULES_H
#define _NEBMODULES_H
#ifdef __cplusplus
extern "C" {
#endif
/***** MODULE VERSION INFORMATION *****/
#define NEB_API_VERSION(x) int __neb_api_version = x;
#define CURRENT_NEB_API_VERSION 3
/***** MODULE INFORMATION *****/
#define NEBMODULE_MODINFO_NUMITEMS 6
#define NEBMODULE_MODINFO_TITLE 0
#define NEBMODULE_MODINFO_AUTHOR 1
#define NEBMODULE_MODINFO_COPYRIGHT 2
#define NEBMODULE_MODINFO_VERSION 3
#define NEBMODULE_MODINFO_LICENSE 4
#define NEBMODULE_MODINFO_DESC 5
/***** MODULE LOAD/UNLOAD OPTIONS *****/
#define NEBMODULE_NORMAL_LOAD 0 /* module is being loaded normally */
#define NEBMODULE_REQUEST_UNLOAD 0 /* request module to unload (but don't force it) */
#define NEBMODULE_FORCE_UNLOAD 1 /* force module to unload */
/***** MODULES UNLOAD REASONS *****/
#define NEBMODULE_NEB_SHUTDOWN 1 /* event broker is shutting down */
#define NEBMODULE_NEB_RESTART 2 /* event broker is restarting */
#define NEBMODULE_ERROR_NO_INIT 3 /* _module_init() function was not found in module */
#define NEBMODULE_ERROR_BAD_INIT 4 /* _module_init() function returned a bad code */
#define NEBMODULE_ERROR_API_VERSION 5 /* module version is incompatible with current api */
/***** MODULE STRUCTURES *****/
/* NEB module structure */
typedef struct nebmodule_struct{
char *filename;
char *args;
char *info[NEBMODULE_MODINFO_NUMITEMS];
int should_be_loaded;
int is_currently_loaded;
#ifdef USE_LTDL
lt_dlhandle module_handle;
lt_ptr init_func;
lt_ptr deinit_func;
#else
void *module_handle;
void *init_func;
void *deinit_func;
#endif
#ifdef HAVE_PTHREAD_H
pthread_t thread_id;
#endif
struct nebmodule_struct *next;
}nebmodule;
/***** MODULE FUNCTIONS *****/
int neb_set_module_info(void *,int,char *);
#ifdef __cplusplus
}
#endif
#endif

533
include/nebstructs.h Normal file
View File

@ -0,0 +1,533 @@
/*****************************************************************************
*
* NEBSTRUCTS.H - Event broker includes for Nagios
*
* Copyright (c) 2003-2007 Ethan Galstad (nagios@nagios.org)
* Last Modified: 10-28-2007
*
* License:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*****************************************************************************/
#ifndef _NEBSTRUCTS_H
#define _NEBSTRUCTS_H
#include "config.h"
#include "pnp.h"
#include "objects.h"
#include "nagios.h"
#ifdef __cplusplus
extern "C" {
#endif
/****** STRUCTURES *************************/
/* process data structure */
typedef struct nebstruct_process_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
}nebstruct_process_data;
/* timed event data structure */
typedef struct nebstruct_timed_event_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
int event_type;
int recurring;
time_t run_time;
void *event_data;
void *event_ptr;
}nebstruct_timed_event_data;
/* log data structure */
typedef struct nebstruct_log_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
time_t entry_time;
int data_type;
char *data;
}nebstruct_log_data;
/* system command structure */
typedef struct nebstruct_system_command_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
struct timeval start_time;
struct timeval end_time;
int timeout;
char *command_line;
int early_timeout;
double execution_time;
int return_code;
char *output;
}nebstruct_system_command_data;
/* event handler structure */
typedef struct nebstruct_event_handler_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
int eventhandler_type;
char *host_name;
char *service_description;
int state_type;
int state;
int timeout;
char *command_name;
char *command_args;
char *command_line;
struct timeval start_time;
struct timeval end_time;
int early_timeout;
double execution_time;
int return_code;
char *output;
void *object_ptr;
}nebstruct_event_handler_data;
/* host check structure */
typedef struct nebstruct_host_check_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
char *host_name;
int current_attempt;
int check_type;
int max_attempts;
int state_type;
int state;
int timeout;
char *command_name;
char *command_args;
char *command_line;
struct timeval start_time;
struct timeval end_time;
int early_timeout;
double execution_time;
double latency;
int return_code;
char *output;
char *long_output;
char *perf_data;
void *object_ptr;
}nebstruct_host_check_data;
/* service check structure */
typedef struct nebstruct_service_check_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
char *host_name;
char *service_description;
int check_type;
int current_attempt;
int max_attempts;
int state_type;
int state;
int timeout;
char *command_name;
char *command_args;
char *command_line;
struct timeval start_time;
struct timeval end_time;
int early_timeout;
double execution_time;
double latency;
int return_code;
char *output;
char *long_output;
char *perf_data;
void *object_ptr;
}nebstruct_service_check_data;
/* comment data structure */
typedef struct nebstruct_comment_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
int comment_type;
char *host_name;
char *service_description;
time_t entry_time;
char *author_name;
char *comment_data;
int persistent;
int source;
int entry_type;
int expires;
time_t expire_time;
unsigned long comment_id;
void *object_ptr; /* not implemented yet */
}nebstruct_comment_data;
/* downtime data structure */
typedef struct nebstruct_downtime_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
int downtime_type;
char *host_name;
char *service_description;
time_t entry_time;
char *author_name;
char *comment_data;
time_t start_time;
time_t end_time;
int fixed;
unsigned long duration;
unsigned long triggered_by;
unsigned long downtime_id;
void *object_ptr; /* not implemented yet */
}nebstruct_downtime_data;
/* flapping data structure */
typedef struct nebstruct_flapping_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
int flapping_type;
char *host_name;
char *service_description;
double percent_change;
double high_threshold;
double low_threshold;
unsigned long comment_id;
void *object_ptr;
}nebstruct_flapping_data;
/* program status structure */
typedef struct nebstruct_program_status_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
time_t program_start;
int pid;
int daemon_mode;
time_t last_command_check;
time_t last_log_rotation;
int notifications_enabled;
int active_service_checks_enabled;
int passive_service_checks_enabled;
int active_host_checks_enabled;
int passive_host_checks_enabled;
int event_handlers_enabled;
int flap_detection_enabled;
int failure_prediction_enabled;
int process_performance_data;
int obsess_over_hosts;
int obsess_over_services;
unsigned long modified_host_attributes;
unsigned long modified_service_attributes;
char *global_host_event_handler;
char *global_service_event_handler;
}nebstruct_program_status_data;
/* host status structure */
typedef struct nebstruct_host_status_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
void *object_ptr;
}nebstruct_host_status_data;
/* service status structure */
typedef struct nebstruct_service_status_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
void *object_ptr;
}nebstruct_service_status_data;
/* contact status structure */
typedef struct nebstruct_contact_status_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
void *object_ptr;
}nebstruct_contact_status_data;
/* notification data structure */
typedef struct nebstruct_notification_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
int notification_type;
struct timeval start_time;
struct timeval end_time;
char *host_name;
char *service_description;
int reason_type;
int state;
char *output;
char *ack_author;
char *ack_data;
int escalated;
int contacts_notified;
void *object_ptr;
}nebstruct_notification_data;
/* contact notification data structure */
typedef struct nebstruct_contact_notification_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
int notification_type;
struct timeval start_time;
struct timeval end_time;
char *host_name;
char *service_description;
char *contact_name;
int reason_type;
int state;
char *output;
char *ack_author;
char *ack_data;
int escalated;
void *object_ptr;
void *contact_ptr;
}nebstruct_contact_notification_data;
/* contact notification method data structure */
typedef struct nebstruct_contact_notification_method_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
int notification_type;
struct timeval start_time;
struct timeval end_time;
char *host_name;
char *service_description;
char *contact_name;
char *command_name;
char *command_args;
int reason_type;
int state;
char *output;
char *ack_author;
char *ack_data;
int escalated;
void *object_ptr;
void *contact_ptr;
}nebstruct_contact_notification_method_data;
/* adaptive program data structure */
typedef struct nebstruct_adaptive_program_data_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
int command_type;
unsigned long modified_host_attribute;
unsigned long modified_host_attributes;
unsigned long modified_service_attribute;
unsigned long modified_service_attributes;
}nebstruct_adaptive_program_data;
/* adaptive host data structure */
typedef struct nebstruct_adaptive_host_data_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
int command_type;
unsigned long modified_attribute;
unsigned long modified_attributes;
void *object_ptr;
}nebstruct_adaptive_host_data;
/* adaptive service data structure */
typedef struct nebstruct_adaptive_service_data_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
int command_type;
unsigned long modified_attribute;
unsigned long modified_attributes;
void *object_ptr;
}nebstruct_adaptive_service_data;
/* adaptive contact data structure */
typedef struct nebstruct_adaptive_contact_data_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
int command_type;
unsigned long modified_attribute;
unsigned long modified_attributes;
unsigned long modified_host_attribute;
unsigned long modified_host_attributes;
unsigned long modified_service_attribute;
unsigned long modified_service_attributes;
void *object_ptr;
}nebstruct_adaptive_contact_data;
/* external command data structure */
typedef struct nebstruct_external_command_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
int command_type;
time_t entry_time;
char *command_string;
char *command_args;
}nebstruct_external_command_data;
/* aggregated status data structure */
typedef struct nebstruct_aggregated_status_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
}nebstruct_aggregated_status_data;
/* retention data structure */
typedef struct nebstruct_retention_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
}nebstruct_retention_data;
/* acknowledgement structure */
typedef struct nebstruct_acknowledgement_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
int acknowledgement_type;
char *host_name;
char *service_description;
int state;
char *author_name;
char *comment_data;
int is_sticky;
int persistent_comment;
int notify_contacts;
void *object_ptr;
}nebstruct_acknowledgement_data;
/* state change structure */
typedef struct nebstruct_statechange_struct{
int type;
int flags;
int attr;
struct timeval timestamp;
int statechange_type;
char *host_name;
char *service_description;
int state;
int state_type;
int current_attempt;
int max_attempts;
char *output;
void *object_ptr;
}nebstruct_statechange_data;
#ifdef __cplusplus
}
#endif
#endif

41
include/npcdmod.h Normal file
View File

@ -0,0 +1,41 @@
/*****************************************************************************
*
* NPCDMOD.H
*
* Copyright (c) 2008 Hendrik Baecker (http://www.pnp4nagios.org)
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Last Modified: 11-18-2008
*
*****************************************************************************/
#define PERFDATA_BUFFER 65536
/* MMAPFILE structure - used for reading files via mmap() */
typedef struct pnp_mmapfile_struct {
char *path;
int mode;
int fd;
unsigned long file_size;
unsigned long current_position;
unsigned long current_line;
void *mmap_buf;
} pnp_mmapfile;
pnp_mmapfile *pnp_mmap_fopen(char *); /* open a file read-only via mmap() */
int pnp_mmap_fclose(pnp_mmapfile *);
char *pnp_mmap_fgets(pnp_mmapfile *);
char *pnp_mmap_fgets_multiline(pnp_mmapfile *);
extern void pnp_strip(char *);

771
include/objects.h Normal file
View File

@ -0,0 +1,771 @@
/*****************************************************************************
*
* OBJECTS.H - Header file for object addition/search functions
*
* Copyright (c) 1999-2007 Ethan Galstad (nagios@nagios.org)
* Last Modified: 11-10-2007
*
* License:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*****************************************************************************/
#ifndef _OBJECTS_H
#define _OBJECTS_H
#include "config.h"
#include "common.h"
#ifdef __cplusplus
extern "C" {
#endif
/*************** CURRENT OBJECT REVISION **************/
#define CURRENT_OBJECT_STRUCTURE_VERSION 307 /* increment when changes are made to data structures... */
/* Nagios 3 starts at 300, Nagios 4 at 400, etc. */
/***************** OBJECT SIZE LIMITS *****************/
#define MAX_STATE_HISTORY_ENTRIES 21 /* max number of old states to keep track of for flap detection */
#define MAX_CONTACT_ADDRESSES 6 /* max number of custom addresses a contact can have */
/***************** SKIP LISTS ****************/
#define NUM_OBJECT_SKIPLISTS 13
#define HOST_SKIPLIST 1
#define SERVICE_SKIPLIST 2
#define COMMAND_SKIPLIST 3
#define TIMEPERIOD_SKIPLIST 4
#define CONTACT_SKIPLIST 5
#define CONTACTGROUP_SKIPLIST 6
#define HOSTGROUP_SKIPLIST 7
#define SERVICEGROUP_SKIPLIST 8
#define HOSTDEPENDENCY_SKIPLIST 9
#define SERVICEDEPENDENCY_SKIPLIST 10
#define HOSTESCALATION_SKIPLIST 11
#define SERVICEESCALATION_SKIPLIST 12
/****************** DATA STRUCTURES *******************/
typedef struct host_struct host;
typedef struct service_struct service;
typedef struct contact_struct contact;
/* OBJECT LIST STRUCTURE */
typedef struct objectlist_struct{
void *object_ptr;
struct objectlist_struct *next;
}objectlist;
/* TIMERANGE structure */
typedef struct timerange_struct{
unsigned long range_start;
unsigned long range_end;
struct timerange_struct *next;
}timerange;
/* DATERANGE structure */
typedef struct daterange_struct{
int type;
int syear; /* start year */
int smon; /* start month */
int smday; /* start day of month (may 3rd, last day in feb) */
int swday; /* start day of week (thursday) */
int swday_offset; /* start weekday offset (3rd thursday, last monday in jan) */
int eyear;
int emon;
int emday;
int ewday;
int ewday_offset;
int skip_interval;
timerange *times;
struct daterange_struct *next;
}daterange;
/* TIMEPERIODEXCLUSION structure */
typedef struct timeperiodexclusion_struct{
char *timeperiod_name;
struct timeperiod_struct *timeperiod_ptr;
struct timeperiodexclusion_struct *next;
}timeperiodexclusion;
/* TIMEPERIOD structure */
typedef struct timeperiod_struct{
char *name;
char *alias;
timerange *days[7];
daterange *exceptions[DATERANGE_TYPES];
timeperiodexclusion *exclusions;
struct timeperiod_struct *next;
struct timeperiod_struct *nexthash;
}timeperiod;
/* CONTACTSMEMBER structure */
typedef struct contactsmember_struct{
char *contact_name;
#ifdef NSCORE
contact *contact_ptr;
#endif
struct contactsmember_struct *next;
}contactsmember;
/* CONTACTGROUP structure */
typedef struct contactgroup_struct{
char *group_name;
char *alias;
contactsmember *members;
struct contactgroup_struct *next;
struct contactgroup_struct *nexthash;
}contactgroup;
/* CONTACTGROUPSMEMBER structure */
typedef struct contactgroupsmember_struct{
char *group_name;
#ifdef NSCORE
contactgroup *group_ptr;
#endif
struct contactgroupsmember_struct *next;
}contactgroupsmember;
/* CUSTOMVARIABLESMEMBER structure */
typedef struct customvariablesmember_struct{
char *variable_name;
char *variable_value;
int has_been_modified;
struct customvariablesmember_struct *next;
}customvariablesmember;
/* COMMAND structure */
typedef struct command_struct{
char *name;
char *command_line;
struct command_struct *next;
struct command_struct *nexthash;
}command;
/* COMMANDSMEMBER structure */
typedef struct commandsmember_struct{
char *command;
#ifdef NSCORE
command *command_ptr;
#endif
struct commandsmember_struct *next;
}commandsmember;
/* CONTACT structure */
struct contact_struct{
char *name;
char *alias;
char *email;
char *pager;
char *address[MAX_CONTACT_ADDRESSES];
commandsmember *host_notification_commands;
commandsmember *service_notification_commands;
int notify_on_service_unknown;
int notify_on_service_warning;
int notify_on_service_critical;
int notify_on_service_recovery;
int notify_on_service_flapping;
int notify_on_service_downtime;
int notify_on_host_down;
int notify_on_host_unreachable;
int notify_on_host_recovery;
int notify_on_host_flapping;
int notify_on_host_downtime;
char *host_notification_period;
char *service_notification_period;
int host_notifications_enabled;
int service_notifications_enabled;
int can_submit_commands;
int retain_status_information;
int retain_nonstatus_information;
customvariablesmember *custom_variables;
#ifdef NSCORE
time_t last_host_notification;
time_t last_service_notification;
unsigned long modified_attributes;
unsigned long modified_host_attributes;
unsigned long modified_service_attributes;
timeperiod *host_notification_period_ptr;
timeperiod *service_notification_period_ptr;
objectlist *contactgroups_ptr;
#endif
struct contact_struct *next;
struct contact_struct *nexthash;
};
/* SERVICESMEMBER structure */
typedef struct servicesmember_struct{
char *host_name;
char *service_description;
#ifdef NSCORE
service *service_ptr;
#endif
struct servicesmember_struct *next;
}servicesmember;
/* HOSTSMEMBER structure */
typedef struct hostsmember_struct{
char *host_name;
#ifdef NSCORE
host *host_ptr;
#endif
struct hostsmember_struct *next;
}hostsmember;
/* HOSTGROUP structure */
typedef struct hostgroup_struct{
char *group_name;
char *alias;
hostsmember *members;
char *notes;
char *notes_url;
char *action_url;
struct hostgroup_struct *next;
struct hostgroup_struct *nexthash;
}hostgroup;
/* HOST structure */
struct host_struct{
char *name;
char *display_name;
char *alias;
char *address;
hostsmember *parent_hosts;
hostsmember *child_hosts;
servicesmember *services;
char *host_check_command;
int initial_state;
double check_interval;
double retry_interval;
int max_attempts;
char *event_handler;
contactgroupsmember *contact_groups;
contactsmember *contacts;
double notification_interval;
double first_notification_delay;
int notify_on_down;
int notify_on_unreachable;
int notify_on_recovery;
int notify_on_flapping;
int notify_on_downtime;
char *notification_period;
char *check_period;
int flap_detection_enabled;
double low_flap_threshold;
double high_flap_threshold;
int flap_detection_on_up;
int flap_detection_on_down;
int flap_detection_on_unreachable;
int stalk_on_up;
int stalk_on_down;
int stalk_on_unreachable;
int check_freshness;
int freshness_threshold;
int process_performance_data;
int checks_enabled;
int accept_passive_host_checks;
int event_handler_enabled;
int retain_status_information;
int retain_nonstatus_information;
int failure_prediction_enabled;
char *failure_prediction_options;
int obsess_over_host;
char *notes;
char *notes_url;
char *action_url;
char *icon_image;
char *icon_image_alt;
char *vrml_image;
char *statusmap_image;
int have_2d_coords;
int x_2d;
int y_2d;
int have_3d_coords;
double x_3d;
double y_3d;
double z_3d;
int should_be_drawn;
customvariablesmember *custom_variables;
#ifdef NSCORE
int problem_has_been_acknowledged;
int acknowledgement_type;
int check_type;
int current_state;
int last_state;
int last_hard_state;
char *plugin_output;
char *long_plugin_output;
char *perf_data;
int state_type;
int current_attempt;
unsigned long current_event_id;
unsigned long last_event_id;
unsigned long current_problem_id;
unsigned long last_problem_id;
double latency;
double execution_time;
int is_executing;
int check_options;
int notifications_enabled;
time_t last_host_notification;
time_t next_host_notification;
time_t next_check;
int should_be_scheduled;
time_t last_check;
time_t last_state_change;
time_t last_hard_state_change;
time_t last_time_up;
time_t last_time_down;
time_t last_time_unreachable;
int has_been_checked;
int is_being_freshened;
int notified_on_down;
int notified_on_unreachable;
int current_notification_number;
int no_more_notifications;
unsigned long current_notification_id;
int check_flapping_recovery_notification;
int scheduled_downtime_depth;
int pending_flex_downtime;
int state_history[MAX_STATE_HISTORY_ENTRIES]; /* flap detection */
int state_history_index;
time_t last_state_history_update;
int is_flapping;
unsigned long flapping_comment_id;
double percent_state_change;
int total_services;
unsigned long total_service_check_interval;
unsigned long modified_attributes;
int circular_path_checked;
int contains_circular_path;
command *event_handler_ptr;
command *check_command_ptr;
timeperiod *check_period_ptr;
timeperiod *notification_period_ptr;
objectlist *hostgroups_ptr;
#endif
struct host_struct *next;
struct host_struct *nexthash;
};
/* SERVICEGROUP structure */
typedef struct servicegroup_struct{
char *group_name;
char *alias;
servicesmember *members;
char *notes;
char *notes_url;
char *action_url;
struct servicegroup_struct *next;
struct servicegroup_struct *nexthash;
}servicegroup;
/* SERVICE structure */
struct service_struct{
char *host_name;
char *description;
char *display_name;
char *service_check_command;
char *event_handler;
int initial_state;
double check_interval;
double retry_interval;
int max_attempts;
int parallelize;
contactgroupsmember *contact_groups;
contactsmember *contacts;
double notification_interval;
double first_notification_delay;
int notify_on_unknown;
int notify_on_warning;
int notify_on_critical;
int notify_on_recovery;
int notify_on_flapping;
int notify_on_downtime;
int stalk_on_ok;
int stalk_on_warning;
int stalk_on_unknown;
int stalk_on_critical;
int is_volatile;
char *notification_period;
char *check_period;
int flap_detection_enabled;
double low_flap_threshold;
double high_flap_threshold;
int flap_detection_on_ok;
int flap_detection_on_warning;
int flap_detection_on_unknown;
int flap_detection_on_critical;
int process_performance_data;
int check_freshness;
int freshness_threshold;
int accept_passive_service_checks;
int event_handler_enabled;
int checks_enabled;
int retain_status_information;
int retain_nonstatus_information;
int notifications_enabled;
int obsess_over_service;
int failure_prediction_enabled;
char *failure_prediction_options;
char *notes;
char *notes_url;
char *action_url;
char *icon_image;
char *icon_image_alt;
customvariablesmember *custom_variables;
#ifdef NSCORE
int problem_has_been_acknowledged;
int acknowledgement_type;
int host_problem_at_last_check;
int check_type;
int current_state;
int last_state;
int last_hard_state;
char *plugin_output;
char *long_plugin_output;
char *perf_data;
int state_type;
time_t next_check;
int should_be_scheduled;
time_t last_check;
int current_attempt;
unsigned long current_event_id;
unsigned long last_event_id;
unsigned long current_problem_id;
unsigned long last_problem_id;
time_t last_notification;
time_t next_notification;
int no_more_notifications;
int check_flapping_recovery_notification;
time_t last_state_change;
time_t last_hard_state_change;
time_t last_time_ok;
time_t last_time_warning;
time_t last_time_unknown;
time_t last_time_critical;
int has_been_checked;
int is_being_freshened;
int notified_on_unknown;
int notified_on_warning;
int notified_on_critical;
int current_notification_number;
unsigned long current_notification_id;
double latency;
double execution_time;
int is_executing;
int check_options;
int scheduled_downtime_depth;
int pending_flex_downtime;
int state_history[MAX_STATE_HISTORY_ENTRIES]; /* flap detection */
int state_history_index;
int is_flapping;
unsigned long flapping_comment_id;
double percent_state_change;
unsigned long modified_attributes;
host *host_ptr;
command *event_handler_ptr;
char *event_handler_args;
command *check_command_ptr;
char *check_command_args;
timeperiod *check_period_ptr;
timeperiod *notification_period_ptr;
objectlist *servicegroups_ptr;
#endif
struct service_struct *next;
struct service_struct *nexthash;
};
/* SERVICE ESCALATION structure */
typedef struct serviceescalation_struct{
char *host_name;
char *description;
int first_notification;
int last_notification;
double notification_interval;
char *escalation_period;
int escalate_on_recovery;
int escalate_on_warning;
int escalate_on_unknown;
int escalate_on_critical;
contactgroupsmember *contact_groups;
contactsmember *contacts;
#ifdef NSCORE
service *service_ptr;
timeperiod *escalation_period_ptr;
#endif
struct serviceescalation_struct *next;
struct serviceescalation_struct *nexthash;
}serviceescalation;
/* SERVICE DEPENDENCY structure */
typedef struct servicedependency_struct{
int dependency_type;
char *dependent_host_name;
char *dependent_service_description;
char *host_name;
char *service_description;
char *dependency_period;
int inherits_parent;
int fail_on_ok;
int fail_on_warning;
int fail_on_unknown;
int fail_on_critical;
int fail_on_pending;
#ifdef NSCORE
int circular_path_checked;
int contains_circular_path;
service *master_service_ptr;
service *dependent_service_ptr;
timeperiod *dependency_period_ptr;
#endif
struct servicedependency_struct *next;
struct servicedependency_struct *nexthash;
}servicedependency;
/* HOST ESCALATION structure */
typedef struct hostescalation_struct{
char *host_name;
int first_notification;
int last_notification;
double notification_interval;
char *escalation_period;
int escalate_on_recovery;
int escalate_on_down;
int escalate_on_unreachable;
contactgroupsmember *contact_groups;
contactsmember *contacts;
#ifdef NSCORE
host *host_ptr;
timeperiod *escalation_period_ptr;
#endif
struct hostescalation_struct *next;
struct hostescalation_struct *nexthash;
}hostescalation;
/* HOST DEPENDENCY structure */
typedef struct hostdependency_struct{
int dependency_type;
char *dependent_host_name;
char *host_name;
char *dependency_period;
int inherits_parent;
int fail_on_up;
int fail_on_down;
int fail_on_unreachable;
int fail_on_pending;
#ifdef NSCORE
int circular_path_checked;
int contains_circular_path;
host *master_host_ptr;
host *dependent_host_ptr;
timeperiod *dependency_period_ptr;
#endif
struct hostdependency_struct *next;
struct hostdependency_struct *nexthash;
}hostdependency;
/****************** HASH STRUCTURES ********************/
typedef struct host_cursor_struct{
int host_hashchain_iterator;
host *current_host_pointer;
}host_cursor;
/********************* FUNCTIONS **********************/
/**** Top-level input functions ****/
int read_object_config_data(char *,int,int,int); /* reads all external configuration data of specific types */
/**** Object Creation Functions ****/
contact *add_contact(char *,char *,char *,char *,char **,char *,char *,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int); /* adds a contact definition */
commandsmember *add_service_notification_command_to_contact(contact *,char *); /* adds a service notification command to a contact definition */
commandsmember *add_host_notification_command_to_contact(contact *,char *); /* adds a host notification command to a contact definition */
customvariablesmember *add_custom_variable_to_contact(contact *,char *,char *); /* adds a custom variable to a service definition */
host *add_host(char *,char *,char *,char *,char *,int,double,double,int,int,int,int,int,int,double,double,char *,int,char *,int,int,char *,int,int,double,double,int,int,int,int,int,int,int,int,char *,int,int,char *,char *,char *,char *,char *,char *,char *,int,int,int,double,double,double,int,int,int,int,int); /* adds a host definition */
hostsmember *add_parent_host_to_host(host *,char *); /* adds a parent host to a host definition */
hostsmember *add_child_link_to_host(host *,host *); /* adds a child host to a host definition */
contactgroupsmember *add_contactgroup_to_host(host *,char *); /* adds a contactgroup to a host definition */
contactsmember *add_contact_to_host(host *,char *); /* adds a contact to a host definition */
customvariablesmember *add_custom_variable_to_host(host *,char *,char *); /* adds a custom variable to a host definition */
timeperiod *add_timeperiod(char *,char *); /* adds a timeperiod definition */
timeperiodexclusion *add_exclusion_to_timeperiod(timeperiod *,char *); /* adds an exclusion to a timeperiod */
timerange *add_timerange_to_timeperiod(timeperiod *,int,unsigned long,unsigned long); /* adds a timerange to a timeperiod definition */
daterange *add_exception_to_timeperiod(timeperiod *,int,int,int,int,int,int,int,int,int,int,int,int);
timerange *add_timerange_to_daterange(daterange *,unsigned long,unsigned long);
hostgroup *add_hostgroup(char *,char *,char *,char *,char *); /* adds a hostgroup definition */
hostsmember *add_host_to_hostgroup(hostgroup *, char *); /* adds a host to a hostgroup definition */
servicegroup *add_servicegroup(char *,char *,char *,char *,char *); /* adds a servicegroup definition */
servicesmember *add_service_to_servicegroup(servicegroup *,char *,char *); /* adds a service to a servicegroup definition */
contactgroup *add_contactgroup(char *,char *); /* adds a contactgroup definition */
contactsmember *add_contact_to_contactgroup(contactgroup *,char *); /* adds a contact to a contact group definition */
command *add_command(char *,char *); /* adds a command definition */
service *add_service(char *,char *,char *,char *,int,int,int,int,double,double,double,double,char *,int,int,int,int,int,int,int,int,char *,int,char *,int,int,double,double,int,int,int,int,int,int,int,int,int,int,char *,int,int,char *,char *,char *,char *,char *,int,int,int); /* adds a service definition */
contactgroupsmember *add_contactgroup_to_service(service *,char *); /* adds a contact group to a service definition */
contactsmember *add_contact_to_service(service *,char *); /* adds a contact to a host definition */
serviceescalation *add_serviceescalation(char *,char *,int,int,double,char *,int,int,int,int); /* adds a service escalation definition */
contactgroupsmember *add_contactgroup_to_serviceescalation(serviceescalation *,char *); /* adds a contact group to a service escalation definition */
contactsmember *add_contact_to_serviceescalation(serviceescalation *,char *); /* adds a contact to a service escalation definition */
customvariablesmember *add_custom_variable_to_service(service *,char *,char *); /* adds a custom variable to a service definition */
servicedependency *add_service_dependency(char *,char *,char *,char *,int,int,int,int,int,int,int,char *); /* adds a service dependency definition */
hostdependency *add_host_dependency(char *,char *,int,int,int,int,int,int,char *); /* adds a host dependency definition */
hostescalation *add_hostescalation(char *,int,int,double,char *,int,int,int); /* adds a host escalation definition */
contactsmember *add_contact_to_hostescalation(hostescalation *,char *); /* adds a contact to a host escalation definition */
contactgroupsmember *add_contactgroup_to_hostescalation(hostescalation *,char *); /* adds a contact group to a host escalation definition */
contactsmember *add_contact_to_object(contactsmember **,char *); /* adds a contact to an object */
customvariablesmember *add_custom_variable_to_object(customvariablesmember **,char *,char *); /* adds a custom variable to an object */
servicesmember *add_service_link_to_host(host *,service *);
/*** Object Skiplist Functions ****/
int init_object_skiplists(void);
int free_object_skiplists(void);
int skiplist_compare_text(const char *val1a, const char *val1b, const char *val2a, const char *val2b);
int skiplist_compare_host(void *a, void *b);
int skiplist_compare_service(void *a, void *b);
int skiplist_compare_command(void *a, void *b);
int skiplist_compare_timeperiod(void *a, void *b);
int skiplist_compare_contact(void *a, void *b);
int skiplist_compare_contactgroup(void *a, void *b);
int skiplist_compare_hostgroup(void *a, void *b);
int skiplist_compare_servicegroup(void *a, void *b);
int skiplist_compare_hostescalation(void *a, void *b);
int skiplist_compare_serviceescalation(void *a, void *b);
int skiplist_compare_hostdependency(void *a, void *b);
int skiplist_compare_servicedependency(void *a, void *b);
int get_host_count(void);
int get_service_count(void);
/**** Object Hash Functions ****/
int add_servicedependency_to_hashlist(servicedependency *);
/**** Object Search Functions ****/
timeperiod * find_timeperiod(char *); /* finds a timeperiod object */
host * find_host(char *); /* finds a host object */
hostgroup * find_hostgroup(char *); /* finds a hostgroup object */
servicegroup * find_servicegroup(char *); /* finds a servicegroup object */
contact * find_contact(char *); /* finds a contact object */
contactgroup * find_contactgroup(char *); /* finds a contactgroup object */
command * find_command(char *); /* finds a command object */
service * find_service(char *,char *); /* finds a service object */
/**** Object Traversal Functions ****/
hostescalation *get_first_hostescalation_by_host(char *, void **);
hostescalation *get_next_hostescalation_by_host(char *,void **);
serviceescalation *get_first_serviceescalation_by_service(char *,char *, void **);
serviceescalation *get_next_serviceescalation_by_service(char *,char *,void **);
hostdependency *get_first_hostdependency_by_dependent_host(char *, void **);
hostdependency *get_next_hostdependency_by_dependent_host(char *, void **);
servicedependency *get_first_servicedependency_by_dependent_service(char *,char *, void **);
servicedependency *get_next_servicedependency_by_dependent_service(char *,char *,void **);
#ifdef NSCORE
int add_object_to_objectlist(objectlist **,void *);
int free_objectlist(objectlist **);
#endif
/**** Object Query Functions ****/
int is_host_immediate_child_of_host(host *,host *); /* checks if a host is an immediate child of another host */
int is_host_primary_immediate_child_of_host(host *,host *); /* checks if a host is an immediate child (and primary child) of another host */
int is_host_immediate_parent_of_host(host *,host *); /* checks if a host is an immediate child of another host */
int is_host_member_of_hostgroup(hostgroup *,host *); /* tests whether or not a host is a member of a specific hostgroup */
int is_host_member_of_servicegroup(servicegroup *,host *); /* tests whether or not a service is a member of a specific servicegroup */
int is_service_member_of_servicegroup(servicegroup *,service *); /* tests whether or not a service is a member of a specific servicegroup */
int is_contact_member_of_contactgroup(contactgroup *, contact *); /* tests whether or not a contact is a member of a specific contact group */
int is_contact_for_hostgroup(hostgroup *,contact *); /* tests whether or not a contact is a member of a specific hostgroup */
int is_contact_for_servicegroup(servicegroup *,contact *); /* tests whether or not a contact is a member of a specific servicegroup */
int is_contact_for_host(host *,contact *); /* tests whether or not a contact is a contact member for a specific host */
int is_escalated_contact_for_host(host *,contact *); /* checks whether or not a contact is an escalated contact for a specific host */
int is_contact_for_service(service *,contact *); /* tests whether or not a contact is a contact member for a specific service */
int is_escalated_contact_for_service(service *,contact *); /* checks whether or not a contact is an escalated contact for a specific service */
int is_host_immediate_parent_of_host(host *,host *); /* tests whether or not a host is an immediate parent of another host */
int number_of_immediate_child_hosts(host *); /* counts the number of immediate child hosts for a particular host */
int number_of_total_child_hosts(host *); /* counts the number of total child hosts for a particular host */
int number_of_immediate_parent_hosts(host *); /* counts the number of immediate parents hosts for a particular host */
int number_of_total_parent_hosts(host *); /* counts the number of total parents hosts for a particular host */
#ifdef NSCORE
int check_for_circular_host_path(host *,host *); /* checks if a circular path exists for a given host */
int check_for_circular_servicedependency_path(servicedependency *,servicedependency *,int); /* checks if a circular dependency exists for a given service */
int check_for_circular_hostdependency_path(hostdependency *,hostdependency *,int); /* checks if a circular dependency exists for a given host */
#endif
/**** Object Cleanup Functions ****/
int free_object_data(void); /* frees all allocated memory for the object definitions */
#ifdef __cplusplus
}
#endif
#endif

126
include/pnp.h Normal file
View File

@ -0,0 +1,126 @@
/* #include "../include/global.h" */
/*************************************
* General Header Files
*************************************/
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_TIME_H
#include <time.h>
#endif
#ifdef HAVE_PTHREAD_H
#include <pthread.h>
#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
#ifdef HAVE_GRP_H
#include <grp.h>
#endif
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
/*************************************
Default defines
**************************************/
extern int do_log(char*);
#define LOG(level, msg) (loglevel >= level || loglevel == -1) ? (do_log(msg)) : (0)
#define TRUE 1
#define FALSE 0
#define OK 0
#define ERROR -2
#define MAX_FILENAME_LENGTH 256
#define MAX_VARIABLE_LENGTH 256
#define MAX_VALUE_LENGTH 256
#define MAX_COMMANDLINE_LENGTH 512
#define MAX_BUFFER_SIZE 1024
#define MAX_LOGMESSAGE_SIZE 768
#define CONFIG_OPT_COUNT 15
#define CONFIG_OPT_LOGTYPE 0
#define CONFIG_OPT_LOGFILE 1
#define CONFIG_OPT_LOGFILESIZE 2
#define CONFIG_OPT_LOGLEVEL 3
#define CONFIG_OPT_SCANDIR 4
#define CONFIG_OPT_RUNCMD 5
#define CONFIG_OPT_RUNCMD_ARG 6
#define CONFIG_OPT_MAXTHREADS 7
#define CONFIG_OPT_USER 8
#define CONFIG_OPT_GROUP 9
#define CONFIG_OPT_PIDFILE 10
#define CONFIG_OPT_USELOAD 11
#define CONFIG_OPT_LOAD 12
#define CONFIG_OPT_SLEEPTIME 13
#define CONFIG_OPT_IDENTMYSELF 14

323
install-sh Executable file
View File

@ -0,0 +1,323 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2005-05-14.22
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
chmodcmd="$chmodprog 0755"
chowncmd=
chgrpcmd=
stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=
dst=
dir_arg=
dstarg=
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
-c (ignored)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test -n "$1"; do
case $1 in
-c) shift
continue;;
-d) dir_arg=true
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
--help) echo "$usage"; exit $?;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t) dstarg=$2
shift
shift
continue;;
-T) no_target_directory=true
shift
continue;;
--version) echo "$0 $scriptversion"; exit $?;;
*) # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
test -n "$dir_arg$dstarg" && break
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
break;;
esac
done
if test -z "$1"; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
esac
if test -n "$dir_arg"; then
dst=$src
src=
if test -d "$dst"; then
mkdircmd=:
chmodcmd=
else
mkdircmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dstarg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dstarg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dst=$dst/`basename "$src"`
fi
fi
# This sed command emulates the dirname command.
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# Skip lots of stat calls in the usual case.
if test ! -d "$dstdir"; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
shift
IFS=$oIFS
pathcomp=
while test $# -ne 0 ; do
pathcomp=$pathcomp$1
shift
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp"
# mkdir can fail with a `File exist' error in case several
# install-sh are creating the directory concurrently. This
# is OK.
test -d "$pathcomp" || exit
fi
pathcomp=$pathcomp/
done
fi
if test -n "$dir_arg"; then
$doit $mkdircmd "$dst" \
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
else
dstfile=`basename "$dst"`
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
trap '(exit $?); exit' 1 2 13 15
# Copy the file name to the temp name.
$doit $cpprog "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dstdir/$dstfile"; then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|| {
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit 1
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
}
}
fi || { (exit 1); exit 1; }
done
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit 0
}
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

305
lib/Makefile.in Normal file
View File

@ -0,0 +1,305 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
LOGDIR=@localstatedir@
CFGDIR=@sysconfdir@
BINDIR=@bindir@
CGIDIR=@sbindir@
LIBDIR=@libdir@
INSTALL=@INSTALL@
INSTALL_OPTS=@INSTALL_OPTS@
DATAROOTDIR=@datarootdir@
CP=@CP@
all html:
clean:
distclean: clean
-rm -f Makefile
devclean: distclean
install:
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/controllers
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/i18n
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/helpers
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/libraries
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Database
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Captcha
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Cache
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Image
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Session
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/config
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/core
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/views
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/views/pagination
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/fonts
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/controllers/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/controllers/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/controllers/template.php $(DESTDIR)$(LIBDIR)/kohana/system/controllers/template.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/validation.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/core.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/encrypt.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/orm.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/image.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/session.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/database.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/cache.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/event.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/errors.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/swift.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/validation.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/core.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/encrypt.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/orm.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/image.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/session.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/database.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/cache.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/event.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/errors.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/swift.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/validation.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/core.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/encrypt.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/orm.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/image.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/session.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/database.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/cache.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/event.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/errors.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/swift.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/validation.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/core.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/encrypt.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/orm.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/image.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/session.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/database.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/cache.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/event.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/errors.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/swift.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/validation.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/core.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/encrypt.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/orm.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/image.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/session.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/database.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/cache.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/event.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/errors.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/swift.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/validation.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/core.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/encrypt.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/orm.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/image.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/session.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/database.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/cache.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/event.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/errors.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/swift.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/validation.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/core.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/encrypt.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/orm.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/image.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/session.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/database.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/cache.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/event.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/errors.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/swift.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/remote.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/remote.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/url.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/url.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/feed.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/feed.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/expires.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/expires.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/text.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/text.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/email.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/email.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/download.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/download.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/format.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/format.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/form.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/form.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/arr.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/arr.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/html.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/html.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/valid.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/valid.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/date.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/date.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/file.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/file.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/request.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/request.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/cookie.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/cookie.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/security.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/security.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/num.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/num.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/inflector.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/inflector.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/ORM_Tree.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/ORM_Tree.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Encrypt.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Database_Expression.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Database_Expression.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Event_Observer.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Event_Observer.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Event_Subject.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Event_Subject.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Cache.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Session.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database/Mssql.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Database/Mssql.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database/Pdosqlite.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Database/Pdosqlite.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database/Mysqli.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Database/Mysqli.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database/Pgsql.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Database/Pgsql.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database/Mysql.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Database/Mysql.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Alpha.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Captcha/Alpha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Math.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Captcha/Math.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Word.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Captcha/Word.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Riddle.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Captcha/Riddle.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Basic.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Captcha/Basic.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Black.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Captcha/Black.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Session.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Image.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/Eaccelerator.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Cache/Eaccelerator.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/Apc.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Cache/Apc.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/Memcache.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Cache/Memcache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/Xcache.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Cache/Xcache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/File.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Cache/File.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/Sqlite.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Cache/Sqlite.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Image/GraphicsMagick.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Image/GraphicsMagick.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Image/GD.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Image/GD.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Image/ImageMagick.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Image/ImageMagick.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Session/Cookie.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Session/Cookie.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Session/Cache.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Session/Cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Session/Database.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Session/Database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Image.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Validation.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/ORM_Versioned.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/ORM_Versioned.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Controller.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Controller.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Model.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Model.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/View.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/View.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Router.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Router.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/ORM_Iterator.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/ORM_Iterator.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Profiler_Table.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Profiler_Table.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/URI.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/URI.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/ORM.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/ORM.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Calendar_Event.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Calendar_Event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Tagcloud.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Tagcloud.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Input.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Input.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Database.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/locale.php $(DESTDIR)$(LIBDIR)/kohana/system/config/locale.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/routes.php $(DESTDIR)$(LIBDIR)/kohana/system/config/routes.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/config/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/sql_types.php $(DESTDIR)$(LIBDIR)/kohana/system/config/sql_types.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/config/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/email.php $(DESTDIR)$(LIBDIR)/kohana/system/config/email.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/image.php $(DESTDIR)$(LIBDIR)/kohana/system/config/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/cache_sqlite.php $(DESTDIR)$(LIBDIR)/kohana/system/config/cache_sqlite.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/cache_memcache.php $(DESTDIR)$(LIBDIR)/kohana/system/config/cache_memcache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/session.php $(DESTDIR)$(LIBDIR)/kohana/system/config/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/database.php $(DESTDIR)$(LIBDIR)/kohana/system/config/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/credit_cards.php $(DESTDIR)$(LIBDIR)/kohana/system/config/credit_cards.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/http.php $(DESTDIR)$(LIBDIR)/kohana/system/config/http.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/mimes.php $(DESTDIR)$(LIBDIR)/kohana/system/config/mimes.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/config/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/view.php $(DESTDIR)$(LIBDIR)/kohana/system/config/view.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/cache.php $(DESTDIR)$(LIBDIR)/kohana/system/config/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/encryption.php $(DESTDIR)$(LIBDIR)/kohana/system/config/encryption.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/config/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/cookie.php $(DESTDIR)$(LIBDIR)/kohana/system/config/cookie.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/user_agents.php $(DESTDIR)$(LIBDIR)/kohana/system/config/user_agents.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/inflector.php $(DESTDIR)$(LIBDIR)/kohana/system/config/inflector.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/cache_xcache.php $(DESTDIR)$(LIBDIR)/kohana/system/config/cache_xcache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/Event.php $(DESTDIR)$(LIBDIR)/kohana/system/core/Event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/transliterate_to_ascii.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/transliterate_to_ascii.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/ucfirst.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/ucfirst.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/ord.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/ord.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strrpos.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strrpos.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strtolower.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strtolower.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/substr.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/substr.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/str_pad.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/str_pad.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strcspn.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strcspn.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/trim.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/trim.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/rtrim.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/rtrim.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strcasecmp.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strcasecmp.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strtoupper.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strtoupper.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/str_split.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/str_split.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strpos.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strpos.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/stristr.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/stristr.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/ucwords.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/ucwords.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/str_ireplace.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/str_ireplace.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strlen.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strlen.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/to_unicode.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/to_unicode.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/substr_replace.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/substr_replace.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/from_unicode.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/from_unicode.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strrev.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strrev.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strspn.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strspn.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/ltrim.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/ltrim.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/Benchmark.php $(DESTDIR)$(LIBDIR)/kohana/system/core/Benchmark.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/Bootstrap.php $(DESTDIR)$(LIBDIR)/kohana/system/core/Bootstrap.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/Kohana.php $(DESTDIR)$(LIBDIR)/kohana/system/core/Kohana.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_profiler_table.php $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana_profiler_table.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana/template.php $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana/template.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_error_page.php $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana_error_page.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana_calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/pagination/digg.php $(DESTDIR)$(LIBDIR)/kohana/system/views/pagination/digg.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/pagination/punbb.php $(DESTDIR)$(LIBDIR)/kohana/system/views/pagination/punbb.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/pagination/extended.php $(DESTDIR)$(LIBDIR)/kohana/system/views/pagination/extended.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/pagination/classic.php $(DESTDIR)$(LIBDIR)/kohana/system/views/pagination/classic.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_profiler_table.css $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana_profiler_table.css
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana_profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_error_disabled.php $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana_error_disabled.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_errors.css $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana_errors.css
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/fonts/LICENSE $(DESTDIR)$(LIBDIR)/kohana/system/fonts/LICENSE
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/fonts/DejaVuSerif.ttf $(DESTDIR)$(LIBDIR)/kohana/system/fonts/DejaVuSerif.ttf

View File

@ -0,0 +1,32 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* @package Cache
*
* Cache settings, defined as arrays, or "groups". If no group name is
* used when loading the cache library, the group named "default" will be used.
*
* Each group can be used independently, and multiple groups can be used at once.
*
* Group Options:
* driver - Cache backend driver. Kohana comes with file, database, and memcache drivers.
* > File cache is fast and reliable, but requires many filesystem lookups.
* > Database cache can be used to cache items remotely, but is slower.
* > Memcache is very high performance, but prevents cache tags from being used.
*
* params - Driver parameters, specific to each driver.
*
* lifetime - Default lifetime of caches in seconds. By default caches are stored for
* thirty minutes. Specific lifetime can also be set when creating a new cache.
* Setting this to 0 will never automatically delete caches.
*
* requests - Average number of cache requests that will processed before all expired
* caches are deleted. This is commonly referred to as "garbage collection".
* Setting this to 0 or a negative number will disable automatic garbage collection.
*/
$config['default'] = array
(
'driver' => 'file',
'params' => APPPATH.'cache',
'lifetime' => 1800,
'requests' => 1000
);

View File

@ -0,0 +1,20 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* @package Cache:Memcache
*
* memcache server configuration.
*/
$config['servers'] = array
(
array
(
'host' => '127.0.0.1',
'port' => 11211,
'persistent' => FALSE,
)
);
/**
* Enable cache data compression.
*/
$config['compression'] = FALSE;

View File

@ -0,0 +1,10 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* @package Cache:SQLite
*/
$config['schema'] =
'CREATE TABLE caches(
id VARCHAR(127) PRIMARY KEY,
tags VARCHAR(255),
expiration INTEGER,
cache TEXT);';

View File

@ -0,0 +1,12 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* @package Cache:Xcache
*
* Xcache administrator username.
*/
$config['PHP_AUTH_USER'] = 'kohana';
/**
* Xcache administrator password.
*/
$config['PHP_AUTH_PW'] = 'kohana';

View File

@ -0,0 +1,29 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* @package Core
*
* Captcha configuration is defined in groups which allows you to easily switch
* between different Captcha settings for different forms on your website.
* Note: all groups inherit and overwrite the default group.
*
* Group Options:
* style - Captcha type, e.g. basic, alpha, word, math, riddle
* width - Width of the Captcha image
* height - Height of the Captcha image
* complexity - Difficulty level (0-10), usage depends on chosen style
* background - Path to background image file
* fontpath - Path to font folder
* fonts - Font files
* promote - Valid response count threshold to promote user (FALSE to disable)
*/
$config['default'] = array
(
'style' => 'basic',
'width' => 150,
'height' => 50,
'complexity' => 4,
'background' => '',
'fontpath' => SYSPATH.'fonts/',
'fonts' => array('DejaVuSerif.ttf'),
'promote' => FALSE,
);

View File

@ -0,0 +1,32 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* @package Core
*
* Domain, to restrict the cookie to a specific website domain. For security,
* you are encouraged to set this option. An empty setting allows the cookie
* to be read by any website domain.
*/
$config['domain'] = '';
/**
* Restrict cookies to a specific path, typically the installation directory.
*/
$config['path'] = '/';
/**
* Lifetime of the cookie. A setting of 0 makes the cookie active until the
* users browser is closed or the cookie is deleted.
*/
$config['expire'] = 0;
/**
* Enable this option to only allow the cookie to be read when using the a
* secure protocol.
*/
$config['secure'] = FALSE;
/**
* Enable this option to disable the cookie from being accessed when using a
* secure protocol. This option is only available in PHP 5.2 and above.
*/
$config['httponly'] = FALSE;

View File

@ -0,0 +1,60 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* Credit card validation configuration.
*
* Options for each credit card:
* length - All the allowed card number lengths, in a comma separated string
* prefix - The digits the card needs to start with, in regex format
* luhn - Enable or disable card number validation by the Luhn algorithm
*/
$config = array
(
'default' => array
(
'length' => '13,14,15,16,17,18,19',
'prefix' => '',
'luhn' => TRUE
),
'american express' => array
(
'length' => '15',
'prefix' => '3[47]',
'luhn' => TRUE
),
'diners club' => array
(
'length' => '14,16',
'prefix' => '36|55|30[0-5]',
'luhn' => TRUE
),
'discover' => array
(
'length' => '16',
'prefix' => '6(?:5|011)',
'luhn' => TRUE,
),
'jcb' => array
(
'length' => '15,16',
'prefix' => '3|1800|2131',
'luhn' => TRUE
),
'maestro' => array
(
'length' => '16,18',
'prefix' => '50(?:20|38)|6(?:304|759)',
'luhn' => TRUE
),
'mastercard' => array
(
'length' => '16',
'prefix' => '5[1-5]',
'luhn' => TRUE
),
'visa' => array
(
'length' => '13,16',
'prefix' => '4',
'luhn' => TRUE
),
);

View File

@ -0,0 +1,45 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* @package Database
*
* Database connection settings, defined as arrays, or "groups". If no group
* name is used when loading the database library, the group named "default"
* will be used.
*
* Each group can be connected to independently, and multiple groups can be
* connected at once.
*
* Group Options:
* benchmark - Enable or disable database benchmarking
* persistent - Enable or disable a persistent connection
* connection - Array of connection specific parameters; alternatively,
* you can use a DSN though it is not as fast and certain
* characters could create problems (like an '@' character
* in a password):
* 'connection' => 'mysql://dbuser:secret@localhost/kohana'
* character_set - Database character set
* table_prefix - Database table prefix
* object - Enable or disable object results
* cache - Enable or disable query caching
* escape - Enable automatic query builder escaping
*/
$config['default'] = array
(
'benchmark' => TRUE,
'persistent' => FALSE,
'connection' => array
(
'type' => 'mysql',
'user' => 'dbuser',
'pass' => 'p@ssw0rd',
'host' => 'localhost',
'port' => FALSE,
'socket' => FALSE,
'database' => 'kohana'
),
'character_set' => 'utf8',
'table_prefix' => '',
'object' => TRUE,
'cache' => FALSE,
'escape' => TRUE
);

View File

@ -0,0 +1,22 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* SwiftMailer driver, used with the email helper.
*
* @see http://www.swiftmailer.org/wikidocs/v3/connections/nativemail
* @see http://www.swiftmailer.org/wikidocs/v3/connections/sendmail
* @see http://www.swiftmailer.org/wikidocs/v3/connections/smtp
*
* Valid drivers are: native, sendmail, smtp
*/
$config['driver'] = 'native';
/**
* To use secure connections with SMTP, set "port" to 465 instead of 25.
* To enable TLS, set "encryption" to "tls".
*
* Driver options:
* @param null native: no options
* @param string sendmail: executable path, with -bs or equivalent attached
* @param array smtp: hostname, (username), (password), (port), (auth), (encryption)
*/
$config['options'] = NULL;

View File

@ -0,0 +1,31 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* @package Encrypt
*
* Encrypt configuration is defined in groups which allows you to easily switch
* between different encryption settings for different uses.
* Note: all groups inherit and overwrite the default group.
*
* Group Options:
* key - Encryption key used to do encryption and decryption. The default option
* should never be used for a production website.
*
* For best security, your encryption key should be at least 16 characters
* long and contain letters, numbers, and symbols.
* @note Do not use a hash as your key. This significantly lowers encryption entropy.
*
* mode - MCrypt encryption mode. By default, MCRYPT_MODE_NOFB is used. This mode
* offers initialization vector support, is suited to short strings, and
* produces the shortest encrypted output.
* @see http://php.net/mcrypt
*
* cipher - MCrypt encryption cipher. By default, the MCRYPT_RIJNDAEL_128 cipher is used.
* This is also known as 128-bit AES.
* @see http://php.net/mcrypt
*/
$config['default'] = array
(
'key' => 'K0H@NA+PHP_7hE-SW!FtFraM3w0R|<',
'mode' => MCRYPT_MODE_NOFB,
'cipher' => MCRYPT_RIJNDAEL_128
);

View File

@ -0,0 +1,19 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
// HTTP-EQUIV type meta tags
$config['meta_equiv'] = array
(
'cache-control',
'content-type', 'content-script-type', 'content-style-type',
'content-disposition',
'content-language',
'default-style',
'expires',
'ext-cache',
'pics-label',
'pragma',
'refresh',
'set-cookie',
'vary',
'window-target',
);

View File

@ -0,0 +1,13 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* @package Image
*
* Driver name. Default: GD
*/
$config['driver'] = 'GD';
/**
* Driver parameters:
* ImageMagick - set the "directory" parameter to your ImageMagick installation directory
*/
$config['params'] = array();

View File

@ -0,0 +1,58 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
$config['uncountable'] = array
(
'access',
'advice',
'art',
'baggage',
'dances',
'equipment',
'fish',
'fuel',
'furniture',
'food',
'heat',
'honey',
'homework',
'impatience',
'information',
'knowledge',
'luggage',
'money',
'music',
'news',
'patience',
'progress',
'pollution',
'research',
'rice',
'sand',
'series',
'sheep',
'sms',
'species',
'staff',
'toothpaste',
'traffic',
'understanding',
'water',
'weather',
'work',
);
$config['irregular'] = array
(
'child' => 'children',
'clothes' => 'clothing',
'man' => 'men',
'movie' => 'movies',
'person' => 'people',
'woman' => 'women',
'mouse' => 'mice',
'goose' => 'geese',
'ox' => 'oxen',
'leaf' => 'leaves',
'course' => 'courses',
'size' => 'sizes',
);

View File

@ -0,0 +1,16 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* @package Core
*
* Default language locale name(s).
* First item must be a valid i18n directory name, subsequent items are alternative locales
* for OS's that don't support the first (e.g. Windows). The first valid locale in the array will be used.
* @see http://php.net/setlocale
*/
$config['language'] = array('en_US', 'English_United States');
/**
* Locale timezone. Defaults to use the server timezone.
* @see http://php.net/timezones
*/
$config['timezone'] = '';

View File

@ -0,0 +1,224 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* @package Core
*
* A list of mime types. Our list is generally more complete and accurate than
* the operating system MIME list.
*
* If there are any missing options, please create a ticket on our issue tracker,
* http://kohanaphp.com/trac/newticket. Be sure to give the filename and
* expected MIME type, as well as any additional information you can provide.
*/
$config = array
(
'323' => array('text/h323'),
'7z' => array('application/x-7z-compressed'),
'abw' => array('application/x-abiword'),
'acx' => array('application/internet-property-stream'),
'ai' => array('application/postscript'),
'aif' => array('audio/x-aiff'),
'aifc' => array('audio/x-aiff'),
'aiff' => array('audio/x-aiff'),
'asf' => array('video/x-ms-asf'),
'asr' => array('video/x-ms-asf'),
'asx' => array('video/x-ms-asf'),
'atom' => array('application/atom+xml'),
'avi' => array('video/avi', 'video/msvideo', 'video/x-msvideo'),
'bin' => array('application/octet-stream','application/macbinary'),
'bmp' => array('image/bmp'),
'c' => array('text/x-csrc'),
'c++' => array('text/x-c++src'),
'cab' => array('application/x-cab'),
'cc' => array('text/x-c++src'),
'cda' => array('application/x-cdf'),
'class' => array('application/octet-stream'),
'cpp' => array('text/x-c++src'),
'cpt' => array('application/mac-compactpro'),
'csh' => array('text/x-csh'),
'css' => array('text/css'),
'csv' => array('text/x-comma-separated-values', 'application/vnd.ms-excel', 'text/comma-separated-values', 'text/csv'),
'dbk' => array('application/docbook+xml'),
'dcr' => array('application/x-director'),
'deb' => array('application/x-debian-package'),
'diff' => array('text/x-diff'),
'dir' => array('application/x-director'),
'divx' => array('video/divx'),
'dll' => array('application/octet-stream', 'application/x-msdos-program'),
'dmg' => array('application/x-apple-diskimage'),
'dms' => array('application/octet-stream'),
'doc' => array('application/msword'),
'dvi' => array('application/x-dvi'),
'dxr' => array('application/x-director'),
'eml' => array('message/rfc822'),
'eps' => array('application/postscript'),
'evy' => array('application/envoy'),
'exe' => array('application/x-msdos-program', 'application/octet-stream'),
'fla' => array('application/octet-stream'),
'flac' => array('application/x-flac'),
'flc' => array('video/flc'),
'fli' => array('video/fli'),
'flv' => array('video/x-flv'),
'gif' => array('image/gif'),
'gtar' => array('application/x-gtar'),
'gz' => array('application/x-gzip'),
'h' => array('text/x-chdr'),
'h++' => array('text/x-c++hdr'),
'hh' => array('text/x-c++hdr'),
'hpp' => array('text/x-c++hdr'),
'hqx' => array('application/mac-binhex40'),
'hs' => array('text/x-haskell'),
'htm' => array('text/html'),
'html' => array('text/html'),
'ico' => array('image/x-icon'),
'ics' => array('text/calendar'),
'iii' => array('application/x-iphone'),
'ins' => array('application/x-internet-signup'),
'iso' => array('application/x-iso9660-image'),
'isp' => array('application/x-internet-signup'),
'jar' => array('application/java-archive'),
'java' => array('application/x-java-applet'),
'jpe' => array('image/jpeg', 'image/pjpeg'),
'jpeg' => array('image/jpeg', 'image/pjpeg'),
'jpg' => array('image/jpeg', 'image/pjpeg'),
'js' => array('application/x-javascript'),
'json' => array('application/json'),
'latex' => array('application/x-latex'),
'lha' => array('application/octet-stream'),
'log' => array('text/plain', 'text/x-log'),
'lzh' => array('application/octet-stream'),
'm4a' => array('audio/mpeg'),
'm4p' => array('video/mp4v-es'),
'm4v' => array('video/mp4'),
'man' => array('application/x-troff-man'),
'mdb' => array('application/x-msaccess'),
'midi' => array('audio/midi'),
'mid' => array('audio/midi'),
'mif' => array('application/vnd.mif'),
'mka' => array('audio/x-matroska'),
'mkv' => array('video/x-matroska'),
'mov' => array('video/quicktime'),
'movie' => array('video/x-sgi-movie'),
'mp2' => array('audio/mpeg'),
'mp3' => array('audio/mpeg'),
'mp4' => array('application/mp4','audio/mp4','video/mp4'),
'mpa' => array('video/mpeg'),
'mpe' => array('video/mpeg'),
'mpeg' => array('video/mpeg'),
'mpg' => array('video/mpeg'),
'mpg4' => array('video/mp4'),
'mpga' => array('audio/mpeg'),
'mpp' => array('application/vnd.ms-project'),
'mpv' => array('video/x-matroska'),
'mpv2' => array('video/mpeg'),
'ms' => array('application/x-troff-ms'),
'msg' => array('application/msoutlook','application/x-msg'),
'msi' => array('application/x-msi'),
'nws' => array('message/rfc822'),
'oda' => array('application/oda'),
'odb' => array('application/vnd.oasis.opendocument.database'),
'odc' => array('application/vnd.oasis.opendocument.chart'),
'odf' => array('application/vnd.oasis.opendocument.forumla'),
'odg' => array('application/vnd.oasis.opendocument.graphics'),
'odi' => array('application/vnd.oasis.opendocument.image'),
'odm' => array('application/vnd.oasis.opendocument.text-master'),
'odp' => array('application/vnd.oasis.opendocument.presentation'),
'ods' => array('application/vnd.oasis.opendocument.spreadsheet'),
'odt' => array('application/vnd.oasis.opendocument.text'),
'oga' => array('audio/ogg'),
'ogg' => array('application/ogg'),
'ogv' => array('video/ogg'),
'otg' => array('application/vnd.oasis.opendocument.graphics-template'),
'oth' => array('application/vnd.oasis.opendocument.web'),
'otp' => array('application/vnd.oasis.opendocument.presentation-template'),
'ots' => array('application/vnd.oasis.opendocument.spreadsheet-template'),
'ott' => array('application/vnd.oasis.opendocument.template'),
'p' => array('text/x-pascal'),
'pas' => array('text/x-pascal'),
'patch' => array('text/x-diff'),
'pbm' => array('image/x-portable-bitmap'),
'pdf' => array('application/pdf', 'application/x-download'),
'php' => array('application/x-httpd-php'),
'php3' => array('application/x-httpd-php'),
'php4' => array('application/x-httpd-php'),
'php5' => array('application/x-httpd-php'),
'phps' => array('application/x-httpd-php-source'),
'phtml' => array('application/x-httpd-php'),
'pl' => array('text/x-perl'),
'pm' => array('text/x-perl'),
'png' => array('image/png', 'image/x-png'),
'po' => array('text/x-gettext-translation'),
'pot' => array('application/vnd.ms-powerpoint'),
'pps' => array('application/vnd.ms-powerpoint'),
'ppt' => array('application/powerpoint'),
'ps' => array('application/postscript'),
'psd' => array('application/x-photoshop', 'image/x-photoshop'),
'pub' => array('application/x-mspublisher'),
'py' => array('text/x-python'),
'qt' => array('video/quicktime'),
'ra' => array('audio/x-realaudio'),
'ram' => array('audio/x-realaudio', 'audio/x-pn-realaudio'),
'rar' => array('application/rar'),
'rgb' => array('image/x-rgb'),
'rm' => array('audio/x-pn-realaudio'),
'rpm' => array('audio/x-pn-realaudio-plugin', 'application/x-redhat-package-manager'),
'rss' => array('application/rss+xml'),
'rtf' => array('text/rtf'),
'rtx' => array('text/richtext'),
'rv' => array('video/vnd.rn-realvideo'),
'sea' => array('application/octet-stream'),
'sh' => array('text/x-sh'),
'shtml' => array('text/html'),
'sit' => array('application/x-stuffit'),
'smi' => array('application/smil'),
'smil' => array('application/smil'),
'so' => array('application/octet-stream'),
'src' => array('application/x-wais-source'),
'svg' => array('image/svg+xml'),
'swf' => array('application/x-shockwave-flash'),
't' => array('application/x-troff'),
'tar' => array('application/x-tar'),
'tcl' => array('text/x-tcl'),
'tex' => array('application/x-tex'),
'text' => array('text/plain'),
'texti' => array('application/x-texinfo'),
'textinfo' => array('application/x-texinfo'),
'tgz' => array('application/x-tar'),
'tif' => array('image/tiff'),
'tiff' => array('image/tiff'),
'torrent' => array('application/x-bittorrent'),
'tr' => array('application/x-troff'),
'tsv' => array('text/tab-separated-values'),
'txt' => array('text/plain'),
'wav' => array('audio/x-wav'),
'wax' => array('audio/x-ms-wax'),
'wbxml' => array('application/wbxml'),
'wm' => array('video/x-ms-wm'),
'wma' => array('audio/x-ms-wma'),
'wmd' => array('application/x-ms-wmd'),
'wmlc' => array('application/wmlc'),
'wmv' => array('video/x-ms-wmv', 'application/octet-stream'),
'wmx' => array('video/x-ms-wmx'),
'wmz' => array('application/x-ms-wmz'),
'word' => array('application/msword', 'application/octet-stream'),
'wp5' => array('application/wordperfect5.1'),
'wpd' => array('application/vnd.wordperfect'),
'wvx' => array('video/x-ms-wvx'),
'xbm' => array('image/x-xbitmap'),
'xcf' => array('image/xcf'),
'xhtml' => array('application/xhtml+xml'),
'xht' => array('application/xhtml+xml'),
'xl' => array('application/excel', 'application/vnd.ms-excel'),
'xla' => array('application/excel', 'application/vnd.ms-excel'),
'xlc' => array('application/excel', 'application/vnd.ms-excel'),
'xlm' => array('application/excel', 'application/vnd.ms-excel'),
'xls' => array('application/excel', 'application/vnd.ms-excel'),
'xlt' => array('application/excel', 'application/vnd.ms-excel'),
'xml' => array('text/xml'),
'xof' => array('x-world/x-vrml'),
'xpm' => array('image/x-xpixmap'),
'xsl' => array('text/xml'),
'xvid' => array('video/x-xvid'),
'xwd' => array('image/x-xwindowdump'),
'z' => array('application/x-compress'),
'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed')
);

View File

@ -0,0 +1,25 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* @package Pagination
*
* Pagination configuration is defined in groups which allows you to easily switch
* between different pagination settings for different website sections.
* Note: all groups inherit and overwrite the default group.
*
* Group Options:
* directory - Views folder in which your pagination style templates reside
* style - Pagination style template (matches view filename)
* uri_segment - URI segment (int or 'label') in which the current page number can be found
* query_string - Alternative to uri_segment: query string key that contains the page number
* items_per_page - Number of items to display per page
* auto_hide - Automatically hides pagination for single pages
*/
$config['default'] = array
(
'directory' => 'pagination',
'style' => 'classic',
'uri_segment' => 3,
'query_string' => '',
'items_per_page' => 20,
'auto_hide' => FALSE,
);

View File

@ -0,0 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* @package Profiler
*
* Array of section names to display in the Profiler, TRUE to display all of them.
* Built in sections are benchmarks, database, session, post and cookies, custom sections can be used too.
*/
$config['show'] = TRUE;

View File

@ -0,0 +1,7 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* @package Core
*
* Sets the default route to "welcome"
*/
$config['_default'] = 'welcome';

View File

@ -0,0 +1,47 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* @package Session
*
* Session driver name.
*/
$config['driver'] = 'cookie';
/**
* Session storage parameter, used by drivers.
*/
$config['storage'] = '';
/**
* Session name.
* It must contain only alphanumeric characters and underscores. At least one letter must be present.
*/
$config['name'] = 'kohanasession';
/**
* Session parameters to validate: user_agent, ip_address, expiration.
*/
$config['validate'] = array('user_agent');
/**
* Enable or disable session encryption.
* Note: this has no effect on the native session driver.
* Note: the cookie driver always encrypts session data. Set to TRUE for stronger encryption.
*/
$config['encryption'] = FALSE;
/**
* Session lifetime. Number of seconds that each session will last.
* A value of 0 will keep the session active until the browser is closed (with a limit of 24h).
*/
$config['expiration'] = 7200;
/**
* Number of page loads before the session id is regenerated.
* A value of 0 will disable automatic session id regeneration.
*/
$config['regenerate'] = 3;
/**
* Percentage probability that the gc (garbage collection) routine is started.
*/
$config['gc_probability'] = 2;

Some files were not shown because too many files have changed in this diff Show More