Imported Upstream version 1.4.16_pre1

This commit is contained in:
Jan Wagner 2013-11-26 23:58:53 +01:00
parent 047baae1ca
commit 212b4b8677
69 changed files with 10803 additions and 2698 deletions

848
COPYING
View file

@ -1,285 +1,626 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
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
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. 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.
them 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.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
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.
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. 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.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
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.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
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.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
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".
TERMS AND CONDITIONS
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.
0. Definitions.
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.
"This License" refers to version 3 of the GNU General Public License.
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.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
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:
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
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.
A "covered work" means either the unmodified Program or a work based
on the Program.
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.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
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.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
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.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
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:
1. Source Code.
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,
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
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,
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
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 "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
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.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
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.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
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.
The Corresponding Source for a work in source code form is that
same work.
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
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
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
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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.
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying 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.
13. Use with the GNU Affero General Public License.
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.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
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.
14. Revised Versions 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
The Free Software Foundation may publish revised and/or new versions of
the GNU 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.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public 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.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
NO WARRANTY
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
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.
15. Disclaimer of Warranty.
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.
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.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
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
@ -287,15 +628,15 @@ 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
state 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
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
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,
@ -304,37 +645,30 @@ the "copyright" line and a pointer to where the full notice is found.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
along with this program. If not, see <http://www.gnu.org/licenses/>.
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:
If the program does terminal interaction, 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'.
<program> Copyright (C) <year> <name of author>
This program 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.
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
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:
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
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.
The GNU 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 Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View file

@ -2,7 +2,7 @@ Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006 Free Software Foundation, Inc.
2006, 2007 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
@ -67,6 +67,9 @@ The simplest way to compile this package is:
all sorts of other programs in order to regenerate files that came
with the distribution.
6. Often, you can also type `make uninstall' to remove the installed
files again.
Compilers and Options
=====================

View file

@ -16,7 +16,7 @@ localedir = $(datadir)/locale
DEFS = -DLOCALEDIR=\"$(localedir)\"
dist-hook:
make THANKS nagios-plugins.spec pkg/fedora/nagios-plugins.spec
$(MAKE) THANKS
echo ${VERSION} >$(distdir)/release
install-root:
@ -28,13 +28,6 @@ test test-debug:
cd plugins && $(MAKE) $@
cd plugins-scripts && $(MAKE) $@
nagios-plugins.spec: nagios-plugins.spec.in
sed "s/%%{VERSION}/${VERSION}/;s/%%{RELEASE}/${RELEASE}/;s/^%%{requires}$$//" $? > $@
pkg/fedora/nagios-plugins.spec: nagios-plugins.spec.in
$(top_srcdir)/mkinstalldirs pkg/fedora
sed "s/%%{VERSION}/${VERSION}/;s/%%{RELEASE}/${RELEASE}/;/^# Requires$$/r $(top_srcdir)/pkg/fedora/requires" $? > $@
# Solaris pkgmk
BUILDDIR = build-solaris
PACKDIR = build-pkg
@ -45,7 +38,9 @@ solpkg:
if [ ! -d $(PACKDIR) ] ; then mkdir $(PACKDIR); fi
$(MAKE) all
$(MAKE) DESTDIR=$$PWD/$(BUILDDIR) install
$(INSTALL) plugins-root/pst3 $(BUILDDIR)$(libexecdir)
$(INSTALL) pkg/solaris/pkginfo $(BUILDDIR)
$(INSTALL) pkg/solaris/preinstall $(BUILDDIR)
cd $(BUILDDIR) && $(PERL) ../$(PKGSCRIPT) ../$(PACKDIR)
THANKS: THANKS.in

View file

@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -34,13 +34,14 @@ host_triplet = @host@
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/command.cfg.in \
$(srcdir)/config.h.in $(srcdir)/test.pl.in \
$(top_srcdir)/configure $(top_srcdir)/pkg/solaris/pkginfo.in \
ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS THANKS \
build-aux/compile build-aux/config.guess \
build-aux/config.rpath build-aux/config.sub build-aux/depcomp \
build-aux/install-sh build-aux/ltmain.sh build-aux/missing \
build-aux/mkinstalldirs config.rpath mkinstalldirs
$(srcdir)/config.h.in $(srcdir)/nagios-plugins.spec.in \
$(srcdir)/test.pl.in $(top_srcdir)/configure \
$(top_srcdir)/pkg/solaris/pkginfo.in ABOUT-NLS AUTHORS COPYING \
ChangeLog INSTALL NEWS THANKS build-aux/compile \
build-aux/config.guess build-aux/config.rpath \
build-aux/config.sub build-aux/depcomp build-aux/install-sh \
build-aux/ltmain.sh build-aux/missing build-aux/mkinstalldirs \
config.rpath mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \
$(top_srcdir)/gl/m4/00gnulib.m4 $(top_srcdir)/gl/m4/alloca.m4 \
@ -138,7 +139,8 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = command.cfg test.pl pkg/solaris/pkginfo
CONFIG_CLEAN_FILES = nagios-plugins.spec command.cfg test.pl \
pkg/solaris/pkginfo
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@ -1057,6 +1059,8 @@ $(srcdir)/config.h.in: $(am__configure_deps)
distclean-hdr:
-rm -f config.h stamp-h1
nagios-plugins.spec: $(top_builddir)/config.status $(srcdir)/nagios-plugins.spec.in
cd $(top_builddir) && $(SHELL) ./config.status $@
command.cfg: $(top_builddir)/config.status $(srcdir)/command.cfg.in
cd $(top_builddir) && $(SHELL) ./config.status $@
test.pl: $(top_builddir)/config.status $(srcdir)/test.pl.in
@ -1148,8 +1152,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@ -1174,8 +1178,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@ -1185,13 +1189,12 @@ ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
@ -1265,6 +1268,10 @@ dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
@ -1291,6 +1298,8 @@ distcheck: dist
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
@ -1442,22 +1451,22 @@ uninstall-am:
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
dist-gzip dist-hook dist-shar dist-tarZ dist-zip distcheck \
distclean distclean-generic distclean-hdr distclean-libtool \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-recursive uninstall uninstall-am
dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-zip \
distcheck distclean distclean-generic distclean-hdr \
distclean-libtool distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-recursive uninstall uninstall-am
dist-hook:
make THANKS nagios-plugins.spec pkg/fedora/nagios-plugins.spec
$(MAKE) THANKS
echo ${VERSION} >$(distdir)/release
install-root:
@ -1469,19 +1478,14 @@ test test-debug:
cd plugins && $(MAKE) $@
cd plugins-scripts && $(MAKE) $@
nagios-plugins.spec: nagios-plugins.spec.in
sed "s/%%{VERSION}/${VERSION}/;s/%%{RELEASE}/${RELEASE}/;s/^%%{requires}$$//" $? > $@
pkg/fedora/nagios-plugins.spec: nagios-plugins.spec.in
$(top_srcdir)/mkinstalldirs pkg/fedora
sed "s/%%{VERSION}/${VERSION}/;s/%%{RELEASE}/${RELEASE}/;/^# Requires$$/r $(top_srcdir)/pkg/fedora/requires" $? > $@
solpkg:
if [ ! -d $(BUILDDIR) ] ; then mkdir $(BUILDDIR); fi
if [ ! -d $(PACKDIR) ] ; then mkdir $(PACKDIR); fi
$(MAKE) all
$(MAKE) DESTDIR=$$PWD/$(BUILDDIR) install
$(INSTALL) plugins-root/pst3 $(BUILDDIR)$(libexecdir)
$(INSTALL) pkg/solaris/pkginfo $(BUILDDIR)
$(INSTALL) pkg/solaris/preinstall $(BUILDDIR)
cd $(BUILDDIR) && $(PERL) ../$(PKGSCRIPT) ../$(PACKDIR)
THANKS: THANKS.in

26
NEWS
View file

@ -1,5 +1,31 @@
This file documents the major additions and syntax changes between releases.
...
ENHANCEMENTS
check_nt UPTIME accepts warning/critical thresholds (Ryan Kelly)
check_disk_smb now allows spaces in share names (#990948, #1370031, Debian #601699)
check_http now uses standard threshold functions (enables floating point and ranges)
check_http now checks for and prints the certificate cn (hostname) in SSL certificate checks (Stéphane Urbanovski)
check_http now supports an optional -S/--ssl value to choose the SSL protocol version (#3066166 - Jason Lunn)
Add perfdata to check_ssh (#3244097 - Marco Beck)
New option to check_smtp to ignore failures when sending QUIT (#3358348 - Duncan Ferguson)
New check_by_ssh -F option which allows for specifying an alternative ssh_config(5) file (#2895334 - Sven Nierlein)
check_sensors now detects faulty sensors unless --ignore-fault is specified (Jan Wagner)
utils.sh now provides a check_range function (Alex Griffin)
Improved the performance of check_users (Marc Remy)
Updated Nagios::Plugin perl module
FIXES
Fix check_disk free space calculation if blocksizes differ within a disk group (Bekar - #2973603)
check_disk_smb now handles NT_STATUS_ACCESS_DENIED properly (Debian #601696)
Make check_snmp work more like v1.4.14 with regard to using special values (Timeticks, STRING) as numeric thresholds
Fix check_ldap overriding the port when --ssl was specified after -p
Fix check_procs where regex input of '|' would get displayed in output - now replaced with ','
Fix segfault in check_host when hostname returns multiple IP addresses (Sebastian Harl)
Fix check_smtp and check_tcp where duplicate messages were displayed for certificate errors
Fix check_ping's parsing of the output of Debian's ping6(1) implementation (#1894850 - Matej Vela)
Disable RFC4507 support, to work around SSL negotiation issues with (at least) some Tomcat versions
1.4.15 27th July 2010
ENHANCEMENTS
New check_ntp_peer -m and -n options to check the number of usable time sources ("truechimers")

8
THANKS
View file

@ -23,6 +23,7 @@ Michael Bakker
Nobuhiro Ban
John Barbuto
Jeremy Baumgartner
Marco Beck
Andreas Behal
Lutz Behnke
Marlo Bell
@ -99,12 +100,14 @@ Aravind Gottipati
Kev Green
Steve Greenland
Olaf Greis
Alex Griffin
Chris Grim
Steven Grimm
Sebastien Guay
Jon Hallett
Steve Hanselman
Ask Bjoern Hansen
Sebastian Harl
Michael Haro
Olli Hauer
Gunnar Hellekson
@ -124,6 +127,7 @@ Nikita Kalabukhov
Frank Kannemann
Roy Sigurd Karlsbakk
Jason Kau
Ryan Kelly
Bo Kersey
Konstantin Khomoutov
Serhan Kiymaz
@ -145,6 +149,7 @@ Craig Leres
Jan Lipphaus
Larry Low
Jacob Lundqvist
Jason Lunn
Guenther Mair
Pawel Malachowski
Michael Markstaller
@ -197,6 +202,7 @@ Olivier 'Babar' Raginel
Phil Randal
Abid Rasheed
Jeremy Reed
Marc Remy
Alessandro Ren
Joe Rhett
Cliff Rice
@ -242,10 +248,12 @@ Ibere Tizio
Julien Touche
Kyle Tucker
Jerome Tytgat
Stéphane Urbanovski
Matthias Urlichs
Matteo HCE Valsasna
Jon Vandegrift
Laurent Vaslin
Matej Vela
Carole Verdon
Ludse Verhoeven
Robert August Vincent

6690
aclocal.m4 vendored

File diff suppressed because it is too large Load diff

View file

@ -1,10 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
timestamp='2006-07-02'
timestamp='2008-01-23'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -56,8 +56,8 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -161,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
@ -329,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:SunOS:5.*:*)
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
@ -531,7 +532,7 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit ;;
*:AIX:*:[45])
*:AIX:*:[456])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
@ -780,7 +781,7 @@ EOF
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
i*:MINGW*:*)
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:windows32*:*)
@ -790,12 +791,18 @@ EOF
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
x86:Interix*:[3456]*)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T:Interix*:[3456]*)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
*:Interix*:[3456]*)
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T | authenticamd)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
echo ia64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
@ -829,7 +836,14 @@ EOF
echo ${UNAME_MACHINE}-pc-minix
exit ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-gnu
else
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@ -950,6 +964,9 @@ EOF
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
@ -1208,6 +1225,15 @@ EOF
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
SX-7:SUPER-UX:*:*)
echo sx7-nec-superux${UNAME_RELEASE}
exit ;;
SX-8:SUPER-UX:*:*)
echo sx8-nec-superux${UNAME_RELEASE}
exit ;;
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
@ -1458,9 +1484,9 @@ This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
If the version you run ($0) is already up to date, please
send the following data and any information you think might be

66
build-aux/config.sub vendored
View file

@ -1,10 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
timestamp='2006-09-20'
timestamp='2008-01-16'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@ -72,8 +72,8 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -245,12 +245,12 @@ case $basic_machine in
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore \
| maxq | mb | microblaze | mcore | mep \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@ -324,7 +324,7 @@ case $basic_machine in
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
@ -369,10 +369,14 @@ case $basic_machine in
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
| xstormy16-* | xtensa-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-*)
;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
basic_machine=$basic_machine-unknown
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
@ -443,6 +447,14 @@ case $basic_machine in
basic_machine=ns32k-sequent
os=-dynix
;;
blackfin)
basic_machine=bfin-unknown
os=-linux
;;
blackfin-*)
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
c90)
basic_machine=c90-cray
os=-unicos
@ -475,8 +487,8 @@ case $basic_machine in
basic_machine=craynv-cray
os=-unicosmp
;;
cr16c)
basic_machine=cr16c-unknown
cr16)
basic_machine=cr16-unknown
os=-elf
;;
crds | unos)
@ -668,6 +680,14 @@ case $basic_machine in
basic_machine=m68k-isi
os=-sysv
;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
;;
m68knommu-*)
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
m88k-omron*)
basic_machine=m88k-omron
;;
@ -683,6 +703,10 @@ case $basic_machine in
basic_machine=i386-pc
os=-mingw32
;;
mingw32ce)
basic_machine=arm-unknown
os=-mingw32ce
;;
miniframe)
basic_machine=m68000-convergent
;;
@ -809,6 +833,14 @@ case $basic_machine in
basic_machine=i860-intel
os=-osf
;;
parisc)
basic_machine=hppa-unknown
os=-linux
;;
parisc-*)
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
pbd)
basic_machine=sparc-tti
;;
@ -925,6 +957,9 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
sh5el)
basic_machine=sh5le-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
@ -1014,6 +1049,10 @@ case $basic_machine in
basic_machine=tic6x-unknown
os=-coff
;;
tile*)
basic_machine=tile-unknown
os=-linux-gnu
;;
tx39)
basic_machine=mipstx39-unknown
;;
@ -1219,7 +1258,7 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers*)
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@ -1414,6 +1453,9 @@ case $basic_machine in
m68*-cisco)
os=-aout
;;
mep-*)
os=-elf
;;
mips*-cisco)
os=-elf
;;

View file

@ -1,9 +1,9 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2006-10-15.18
scriptversion=2007-03-29.01
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@ -215,34 +215,39 @@ aix)
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test -f "$tmpdepfile"; then :
else
stripped=`echo "$stripped" | sed 's,^.*/,,'`
tmpdepfile="$stripped.u"
fi
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile

View file

@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2006-10-14.15
scriptversion=2006-12-25.00
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@ -48,7 +48,7 @@ IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
@ -58,34 +58,49 @@ fi
# Put in absolute file names if you don't have them in your path;
# or use environment 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}"
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_glob=
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
chgrpcmd=
stripcmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
mvcmd="$mvprog"
stripcmd=
src=
dst=
dir_arg=
dstarg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
@ -95,65 +110,55 @@ 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.
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-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.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) shift
continue;;
-c) ;;
-d) dir_arg=true
shift
continue;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
shift
shift
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
continue;;
shift;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
shift;;
-s) stripcmd=$stripprog
shift
continue;;
-s) stripcmd=$stripprog;;
-t) dstarg=$2
shift
shift
continue;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true
shift
continue;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
@ -165,21 +170,22 @@ while test $# -ne 0; do
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dstarg=$arg
dst_arg=$arg
done
fi
@ -224,7 +230,7 @@ for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
@ -242,22 +248,22 @@ do
exit 1
fi
if test -z "$dstarg"; then
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dstarg
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
-*) 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
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
@ -378,26 +384,19 @@ do
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix=/ ;;
-*) prefix=./ ;;
*) prefix= ;;
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
case $posix_glob in
'')
if (set -f) 2>/dev/null; then
posix_glob=true
else
posix_glob=false
fi ;;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob && set -f
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob && set +f
$posix_glob set +f
IFS=$oIFS
prefixes=
@ -459,41 +458,54 @@ do
# 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 $mode "$dsttmp"; } &&
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dst" 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.
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
# 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 "$dst"; then
$doit $rmcmd -f "$dst" 2>/dev/null \
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|| {
echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
else
:
fi
} &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
} || exit 1
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 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.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi

View file

@ -535,6 +535,9 @@
/* Define to 1 if you have the `mprotect' function. */
#undef HAVE_MPROTECT
/* Define to 1 if you have the <mp.h> header file. */
#undef HAVE_MP_H
/* Defined if mysqlclient is found and can compile */
#undef HAVE_MYSQLCLIENT

231
configure vendored
View file

@ -2750,7 +2750,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_files="$ac_config_files gl/Makefile"
ac_config_files="$ac_config_files gl/Makefile nagios-plugins.spec"
ac_aux_dir=
for ac_dir in build-aux "$srcdir"/build-aux; do
@ -13886,6 +13886,211 @@ if test $ac_cv_lib_m_floor = yes; then
fi
for ac_header in mp.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
{ echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
ac_res=`eval echo '${'$as_ac_Header'}'`
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
else
# Is the header compilable?
{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <$ac_header>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
;;
esac
{ echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
ac_res=`eval echo '${'$as_ac_Header'}'`
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
{ echo "$as_me:$LINENO: checking for pow in -lbsd" >&5
echo $ECHO_N "checking for pow in -lbsd... $ECHO_C" >&6; }
if test "${ac_cv_lib_bsd_pow+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lbsd $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char pow ();
int
main ()
{
return pow ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_bsd_pow=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_bsd_pow=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_pow" >&5
echo "${ECHO_T}$ac_cv_lib_bsd_pow" >&6; }
if test $ac_cv_lib_bsd_pow = yes; then
MATHLIBS="$MATHLIBS -lbsd"
fi
# Check whether --enable-libtap was given.
if test "${enable_libtap+set}" = set; then
@ -15391,6 +15596,12 @@ fi
fi
np_mysql_libs="`$np_mysql_config --libs`"
np_mysql_cflags="`$np_mysql_config --cflags`"
# On Solaris, cflags may contain -xstrconst, which is not acceptable to the
# gcc compiler. In this case, use the include flags as the cflags
echo $np_mysql_cflags | grep -- -xstrconst > /dev/null 2> /dev/null
if test $? -eq 0 -a "$CC" = "gcc" ; then
np_mysql_cflags="`$np_mysql_config --include`"
fi
_savedcppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $np_mysql_include"
@ -56405,6 +56616,7 @@ for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"gl/Makefile") CONFIG_FILES="$CONFIG_FILES gl/Makefile" ;;
"nagios-plugins.spec") CONFIG_FILES="$CONFIG_FILES nagios-plugins.spec" ;;
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
@ -58047,21 +58259,22 @@ echo "$as_me: $ac_file is unchanged" >&6;}
fi
rm -f "$tmp/out12"
# Compute $ac_file's index in $config_headers.
_am_arg=$ac_file
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$ac_file | $ac_file:* )
$_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X$ac_file : 'X\(//\)[^/]' \| \
X$ac_file : 'X\(//\)$' \| \
X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
echo X$ac_file |
echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$_am_arg" : 'X\(//\)[^/]' \| \
X"$_am_arg" : 'X\(//\)$' \| \
X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$_am_arg" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@ -58098,7 +58311,7 @@ echo "$as_me: executing $ac_file commands" >&6;}
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \

View file

@ -2,7 +2,8 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(nagios-plugins,1.4.15)
AC_CONFIG_SRCDIR(NPTest.pm)
AC_CONFIG_FILES(gl/Makefile)
AC_CONFIG_FILES([gl/Makefile
nagios-plugins.spec])
AC_CONFIG_AUX_DIR(build-aux)
AM_INIT_AUTOMAKE([1.8.3])
AM_CONFIG_HEADER(config.h)
@ -162,6 +163,8 @@ dnl
dnl check for math-related functions needing -lm
AC_CHECK_HEADERS(math.h)
AC_CHECK_LIB(m,floor,MATHLIBS="-lm")
AC_CHECK_HEADERS(mp.h)
AC_CHECK_LIB(bsd,pow,MATHLIBS="$MATHLIBS -lbsd")
AC_SUBST(MATHLIBS)
dnl Check if we buils local libtap

View file

@ -71,7 +71,8 @@ while(defined $nextdev){
} elsif (/^($nextdev)\s*:/) {
$device=$1;
$devices{$device}=$device;
if (/active/) {
if (/\sactive/) {
$status{$device} = ''; # Shall be filled later if available
$active{$device} = 1;
}
}
@ -80,7 +81,11 @@ while(defined $nextdev){
}
foreach my $k (sort keys %devices){
if ($status{$k} =~ /_/) {
if (!exists($status{$k})) {
$msg .= sprintf " %s inactive with no status information.",
$devices{$k};
$code = max_state($code, "CRITICAL");
} elsif ($status{$k} =~ /_/) {
if (defined $recovery{$k}) {
$msg .= sprintf " %s status=%s, recovery=%s, finish=%s.",
$devices{$k}, $status{$k}, $recovery{$k}, $finish{$k};
@ -94,10 +99,11 @@ foreach my $k (sort keys %devices){
$code = max_state($code, "OK");
} else {
if ($active{$k}) {
$msg .= sprintf " %s active with no status information.\n",
$msg .= sprintf " %s active with no status information.",
$devices{$k};
$code = max_state($code, "OK");
} else {
# This should't run anymore, but is left as a catch-all
$msg .= sprintf " %s does not exist.\n", $devices{$k};
$code = max_state($code, "CRITICAL");
}

View file

@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -154,7 +154,7 @@ am_libgnu_a_OBJECTS = base64.$(OBJEXT) close-hook.$(OBJEXT) \
xalloc-die.$(OBJEXT) xstrndup.$(OBJEXT)
libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS)
LTLIBRARIES = $(noinst_LTLIBRARIES)
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@ -1345,8 +1345,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@ -1371,8 +1371,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@ -1382,13 +1382,12 @@ ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique

View file

@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -142,7 +142,7 @@ am__libnagiosplug_a_SOURCES_DIST = utils_base.c utils_disk.c \
am_libnagiosplug_a_OBJECTS = utils_base.$(OBJEXT) utils_disk.$(OBJEXT) \
utils_tcp.$(OBJEXT) utils_cmd.$(OBJEXT) $(am__objects_1)
libnagiosplug_a_OBJECTS = $(am_libnagiosplug_a_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@ -1156,8 +1156,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@ -1182,8 +1182,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@ -1193,13 +1193,12 @@ ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique

View file

@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -185,7 +185,7 @@ test_utils_OBJECTS = test_utils.$(OBJEXT)
test_utils_LDADD = $(LDADD)
test_utils_DEPENDENCIES = $(top_srcdir)/lib/libnagiosplug.a \
$(top_srcdir)/gl/libgnu.a
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@ -1172,8 +1172,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@ -1185,8 +1185,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@ -1196,13 +1196,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique

View file

@ -58,6 +58,19 @@ np_add_parameter(struct parameter_list **list, const char *name)
new_path->usedinodes_percent = NULL;
new_path->freeinodes_percent = NULL;
new_path->group = NULL;
new_path->dfree_pct = -1;
new_path->dused_pct = -1;
new_path->total = 0;
new_path->available = 0;
new_path->available_to_root = 0;
new_path->used = 0;
new_path->dused_units = 0;
new_path->dfree_units = 0;
new_path->dtotal_units = 0;
new_path->inodes_total = 0;
new_path->inodes_free = 0;
new_path->dused_inodes_percent = 0;
new_path->dfree_inodes_percent = 0;
if (current == NULL) {
*list = new_path;

View file

@ -24,6 +24,10 @@ struct parameter_list
char *group;
struct mount_entry *best_match;
struct parameter_list *name_next;
uintmax_t total, available, available_to_root, used, inodes_free, inodes_total;
double dfree_pct, dused_pct;
double dused_units, dfree_units, dtotal_units;
double dused_inodes_percent, dfree_inodes_percent;
};
void np_add_name (struct name_list **list, const char *name);

View file

@ -42,6 +42,12 @@ AC_DEFUN([np_mysqlclient],
fi
np_mysql_libs="`$np_mysql_config --libs`"
np_mysql_cflags="`$np_mysql_config --cflags`"
# On Solaris, cflags may contain -xstrconst, which is not acceptable to the
# gcc compiler. In this case, use the include flags as the cflags
echo $np_mysql_cflags | grep -- -xstrconst > /dev/null 2> /dev/null
if test $? -eq 0 -a "$CC" = "gcc" ; then
np_mysql_cflags="`$np_mysql_config --include`"
fi
dnl Test a mysql_init. Some systems have mysql_config, but no headers
_savedcppflags="$CPPFLAGS"

View file

@ -1,3 +1,20 @@
# Macros
%define isaix %(test "`uname -s`" = "AIX" && echo "1" || echo "0")
%define islinux %(test "`uname -s`" = "Linux" && echo "1" || echo "0")
%define isredhatfamily %(test -f /etc/redhat-release && echo "1" || echo "0")
%if %{isaix}
%define _prefix /opt/nagios
# %define _defaultdocdir %{_datadir}/doc
%else
%define _libexecdir %{_exec_prefix}/lib/nagios/plugins
%endif
%define _sysconfdir /etc/nagios
%define npusr nagios
%define nphome /opt/nagios
%define npgrp nagios
Name: nagios-plugins
Version: 1.4.15
Release: 1
@ -9,7 +26,13 @@ URL: http://nagiosplug.sourceforge.net/
Source0: http://dl.sf.net/sourceforge/nagiosplug/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%define npdir %{_builddir}/%{name}-%{version}
%if %{isaix}
Prefix: %{_prefix}
%else
Prefix: %{_prefix}/lib/nagios/plugins
%endif
Packager: Karl DeBisschop <kdebisschop@users.sourceforge.net>
Vendor: Nagios Plugin Development Group
Provides: nagios-plugins
@ -19,6 +42,60 @@ Obsoletes: nagios-plugins-custom nagios-plugins-extras
# Requires
%if %{isaix}
Requires: fping
Requires: gawk
Requires: net-snmp
Requires: net-snmp-perl
Requires: net-snmp-utils
Requires: openldap
Requires: openssl
Requires: perl
Requires: python
Requires: openssl
BuildRequires: fping
BuildRequires: gawk
BuildRequires: net-snmp
BuildRequires: net-snmp-perl
BuildRequires: net-snmp-utils
BuildRequires: openldap-devel
%endif
%if %{isredhatfamily}
Requires: bind-utils
Requires: coreutils
Requires: fping
Requires: gawk
Requires: grep
Requires: iputils
Requires: mysql
Requires: net-snmp-utils
Requires: ntp
Requires: openldap
Requires: openssl
Requires: openssh-clients
Requires: perl
Requires: postgresql-libs
Requires: procps
Requires: python
Requires: samba-client
Requires: shadow-utils
Requires: traceroute
Requires: /usr/bin/mailq
BuildRequires: bind-utils
BuildRequires: coreutils
BuildRequires: iputils
BuildRequires: mysql-devel
BuildRequires: net-snmp-utils
BuildRequires: net-tools
BuildRequires: ntp
BuildRequires: openldap-devel
BuildRequires: openssh-clients
BuildRequires: openssl-devel
BuildRequires: postgresql-devel
BuildRequires: procps
BuildRequires: samba-client
BuildRequires: /usr/bin/mailq
%endif
%description
@ -37,38 +114,79 @@ contains those plugins.
%build
./configure \
%{?isaix: MAKE=gmake} ./configure \
--prefix=%{_prefix} \
--exec-prefix=%{_exec_prefix} \
--libexecdir=%{_exec_prefix}/lib/nagios/plugins \
--sysconfdir=%{_sysconfdir}/nagios \
--libexecdir=%{_libexecdir} \
--sysconfdir=%{_sysconfdir} \
--datadir=%{_datadir} \
--with-cgiurl=/nagios/cgi-bin
ls -1 %{npdir}/plugins > %{npdir}/ls-plugins-before
ls -1 %{npdir}/plugins-root > %{npdir}/ls-plugins-root-before
ls -1 %{npdir}/plugins-scripts > %{npdir}/ls-plugins-scripts-before
make %{?_smp_mflags}
ls -1 %{npdir}/plugins > %{npdir}/ls-plugins-after
ls -1 %{npdir}/plugins-root > %{npdir}/ls-plugins-root-after
ls -1 %{npdir}/plugins-scripts > %{npdir}/ls-plugins-scripts-after
%pre
# Create `nagios' group on the system if necessary
%if %{isaix}
lsgroup %{npgrp} > /dev/null 2> /dev/null
if [ $? -eq 2 ] ; then
mkgroup %{npgrp} || %nnmmsg Unexpected error adding group "%{npgrp}". Aborting install process.
fi
%endif
%if %{islinux}
getent group %{npgrp} > /dev/null 2> /dev/null
if [ $? -ne 0 ] ; then
groupadd %{npgrp} || %nnmmsg Unexpected error adding group "%{npgrp}". Aborting install process.
fi
%endif
# Create `nagios' user on the system if necessary
%if %{isaix}
lsuser %{npusr} > /dev/null 2> /dev/null
if [ $? -eq 2 ] ; then
useradd -d %{nphome} -c "%{npusr}" -g %{npgrp} %{npusr} || \
%nnmmsg Unexpected error adding user "%{npusr}". Aborting install process.
fi
%endif
%if %{islinux}
getent passwd %{npusr} > /dev/null 2> /dev/null
if [ $? -ne 0 ] ; then
useradd -r -d %{nshome} -c "%{npusr}" -g %{npgrp} %{npusr} || \
%nnmmsg Unexpected error adding user "%{npusr}". Aborting install process.
fi
%endif
%install
rm -rf $RPM_BUILD_ROOT
make AM_INSTALL_PROGRAM_FLAGS="" DESTDIR=${RPM_BUILD_ROOT} install
install -d ${RPM_BUILD_ROOT}/etc/nagios
install -m 664 command.cfg ${RPM_BUILD_ROOT}/etc/nagios
build-aux/install-sh -c -d ${RPM_BUILD_ROOT}%{_sysconfdir}
build-aux/install-sh -c -m 664 command.cfg ${RPM_BUILD_ROOT}%{_sysconfdir}
%find_lang %{name}
echo "%defattr(755,%{npusr},%{npgrp})" >> %{name}.lang
comm -13 %{npdir}/ls-plugins-before %{npdir}/ls-plugins-after | egrep -v "\.o$|^\." | gawk -v libexecdir=%{_libexecdir} '{printf( "%s/%s\n", libexecdir, $0);}' >> %{name}.lang
echo "%defattr(755,root,root)" >> %{name}.lang
comm -13 %{npdir}/ls-plugins-root-before %{npdir}/ls-plugins-root-after | egrep -v "\.o$|^\." | gawk -v libexecdir=%{_libexecdir} '{printf( "%s/%s\n", libexecdir, $0);}' >> %{name}.lang
echo "%defattr(755,%{npusr},%{npgrp})" >> %{name}.lang
comm -13 %{npdir}/ls-plugins-scripts-before %{npdir}/ls-plugins-scripts-after | egrep -v "\.o$|^\." | gawk -v libexecdir=%{_libexecdir} '{printf( "%s/%s\n", libexecdir, $0);}' >> %{name}.lang
echo "%{_libexecdir}/utils.pm" >> %{name}.lang
echo "%{_libexecdir}/utils.sh" >> %{name}.lang
%clean
rm -rf $RPM_BUILD_ROOT
%files -f %{name}.lang
%defattr(-,root,root)
%config(missingok,noreplace) /etc/nagios/command.cfg
%config(missingok,noreplace) %{_sysconfdir}/command.cfg
%doc CODING COPYING FAQ INSTALL LEGAL README REQUIREMENTS SUPPORT THANKS
%doc ChangeLog command.cfg
%defattr(775,root,root)
%dir %{_exec_prefix}/lib/nagios/plugins
%if ! %{isaix}
%{_datadir}/locale/de/LC_MESSAGES/nagios-plugins.mo
%{_datadir}/locale/fr/LC_MESSAGES/nagios-plugins.mo
%{_exec_prefix}/lib/nagios/plugins
%endif
%changelog
* Mon May 23 2005 Sean Finney <seanius@seanius.net> - cvs head

199
nagios-plugins.spec.in Normal file
View file

@ -0,0 +1,199 @@
# Macros
%define isaix %(test "`uname -s`" = "AIX" && echo "1" || echo "0")
%define islinux %(test "`uname -s`" = "Linux" && echo "1" || echo "0")
%define isredhatfamily %(test -f /etc/redhat-release && echo "1" || echo "0")
%if %{isaix}
%define _prefix /opt/nagios
# %define _defaultdocdir %{_datadir}/doc
%else
%define _libexecdir %{_exec_prefix}/lib/nagios/plugins
%endif
%define _sysconfdir /etc/nagios
%define npusr nagios
%define nphome /opt/nagios
%define npgrp nagios
Name: nagios-plugins
Version: @PACKAGE_VERSION@
Release: @RELEASE@
Summary: Host/service/network monitoring program plugins for Nagios
Group: Applications/System
License: GPL
URL: http://nagiosplug.sourceforge.net/
Source0: http://dl.sf.net/sourceforge/nagiosplug/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%define npdir %{_builddir}/%{name}-%{version}
%if %{isaix}
Prefix: %{_prefix}
%else
Prefix: %{_prefix}/lib/nagios/plugins
%endif
Packager: Karl DeBisschop <kdebisschop@users.sourceforge.net>
Vendor: Nagios Plugin Development Group
Provides: nagios-plugins
%{!?custom:%global custom 0}
Obsoletes: nagios-plugins-custom nagios-plugins-extras
# Requires
%if %{isaix}
Requires: fping
Requires: gawk
Requires: net-snmp
Requires: net-snmp-perl
Requires: net-snmp-utils
Requires: openldap
Requires: openssl
Requires: perl
Requires: python
Requires: openssl
BuildRequires: fping
BuildRequires: gawk
BuildRequires: net-snmp
BuildRequires: net-snmp-perl
BuildRequires: net-snmp-utils
BuildRequires: openldap-devel
%endif
%if %{isredhatfamily}
Requires: bind-utils
Requires: coreutils
Requires: fping
Requires: gawk
Requires: grep
Requires: iputils
Requires: mysql
Requires: net-snmp-utils
Requires: ntp
Requires: openldap
Requires: openssl
Requires: openssh-clients
Requires: perl
Requires: postgresql-libs
Requires: procps
Requires: python
Requires: samba-client
Requires: shadow-utils
Requires: traceroute
Requires: /usr/bin/mailq
BuildRequires: bind-utils
BuildRequires: coreutils
BuildRequires: iputils
BuildRequires: mysql-devel
BuildRequires: net-snmp-utils
BuildRequires: net-tools
BuildRequires: ntp
BuildRequires: openldap-devel
BuildRequires: openssh-clients
BuildRequires: openssl-devel
BuildRequires: postgresql-devel
BuildRequires: procps
BuildRequires: samba-client
BuildRequires: /usr/bin/mailq
%endif
%description
Nagios is a program that will monitor hosts and services on your
network, and to email or page you when a problem arises or is
resolved. Nagios runs on a unix server as a background or daemon
process, intermittently running checks on various services that you
specify. The actual service checks are performed by separate "plugin"
programs which return the status of the checks to Nagios. This package
contains those plugins.
%prep
%setup -q
%build
%{?isaix: MAKE=gmake} ./configure \
--prefix=%{_prefix} \
--exec-prefix=%{_exec_prefix} \
--libexecdir=%{_libexecdir} \
--sysconfdir=%{_sysconfdir} \
--datadir=%{_datadir} \
--with-cgiurl=/nagios/cgi-bin
ls -1 %{npdir}/plugins > %{npdir}/ls-plugins-before
ls -1 %{npdir}/plugins-root > %{npdir}/ls-plugins-root-before
ls -1 %{npdir}/plugins-scripts > %{npdir}/ls-plugins-scripts-before
make %{?_smp_mflags}
ls -1 %{npdir}/plugins > %{npdir}/ls-plugins-after
ls -1 %{npdir}/plugins-root > %{npdir}/ls-plugins-root-after
ls -1 %{npdir}/plugins-scripts > %{npdir}/ls-plugins-scripts-after
%pre
# Create `nagios' group on the system if necessary
%if %{isaix}
lsgroup %{npgrp} > /dev/null 2> /dev/null
if [ $? -eq 2 ] ; then
mkgroup %{npgrp} || %nnmmsg Unexpected error adding group "%{npgrp}". Aborting install process.
fi
%endif
%if %{islinux}
getent group %{npgrp} > /dev/null 2> /dev/null
if [ $? -ne 0 ] ; then
groupadd %{npgrp} || %nnmmsg Unexpected error adding group "%{npgrp}". Aborting install process.
fi
%endif
# Create `nagios' user on the system if necessary
%if %{isaix}
lsuser %{npusr} > /dev/null 2> /dev/null
if [ $? -eq 2 ] ; then
useradd -d %{nphome} -c "%{npusr}" -g %{npgrp} %{npusr} || \
%nnmmsg Unexpected error adding user "%{npusr}". Aborting install process.
fi
%endif
%if %{islinux}
getent passwd %{npusr} > /dev/null 2> /dev/null
if [ $? -ne 0 ] ; then
useradd -r -d %{nshome} -c "%{npusr}" -g %{npgrp} %{npusr} || \
%nnmmsg Unexpected error adding user "%{npusr}". Aborting install process.
fi
%endif
%install
rm -rf $RPM_BUILD_ROOT
make AM_INSTALL_PROGRAM_FLAGS="" DESTDIR=${RPM_BUILD_ROOT} install
build-aux/install-sh -c -d ${RPM_BUILD_ROOT}%{_sysconfdir}
build-aux/install-sh -c -m 664 command.cfg ${RPM_BUILD_ROOT}%{_sysconfdir}
%find_lang %{name}
echo "%defattr(755,%{npusr},%{npgrp})" >> %{name}.lang
comm -13 %{npdir}/ls-plugins-before %{npdir}/ls-plugins-after | egrep -v "\.o$|^\." | gawk -v libexecdir=%{_libexecdir} '{printf( "%s/%s\n", libexecdir, $0);}' >> %{name}.lang
echo "%defattr(755,root,root)" >> %{name}.lang
comm -13 %{npdir}/ls-plugins-root-before %{npdir}/ls-plugins-root-after | egrep -v "\.o$|^\." | gawk -v libexecdir=%{_libexecdir} '{printf( "%s/%s\n", libexecdir, $0);}' >> %{name}.lang
echo "%defattr(755,%{npusr},%{npgrp})" >> %{name}.lang
comm -13 %{npdir}/ls-plugins-scripts-before %{npdir}/ls-plugins-scripts-after | egrep -v "\.o$|^\." | gawk -v libexecdir=%{_libexecdir} '{printf( "%s/%s\n", libexecdir, $0);}' >> %{name}.lang
echo "%{_libexecdir}/utils.pm" >> %{name}.lang
echo "%{_libexecdir}/utils.sh" >> %{name}.lang
%clean
rm -rf $RPM_BUILD_ROOT
%files -f %{name}.lang
%config(missingok,noreplace) %{_sysconfdir}/command.cfg
%doc CODING COPYING FAQ INSTALL LEGAL README REQUIREMENTS SUPPORT THANKS
%doc ChangeLog command.cfg
%if ! %{isaix}
%{_datadir}/locale/de/LC_MESSAGES/nagios-plugins.mo
%{_datadir}/locale/fr/LC_MESSAGES/nagios-plugins.mo
%endif
%changelog
* Mon May 23 2005 Sean Finney <seanius@seanius.net> - cvs head
- just include the nagios plugins directory, which will automatically include
all generated plugins (which keeps the build from failing on systems that
don't have all build-dependencies for every plugin)
* Tue Mar 04 2004 Karl DeBisschop <karl[AT]debisschop.net> - 1.4.0alpha1
- extensive rewrite to facilitate processing into various distro-compatible specs
* Tue Mar 04 2004 Karl DeBisschop <karl[AT]debisschop.net> - 1.4.0alpha1
- extensive rewrite to facilitate processing into various distro-compatible specs

View file

@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# perlmods/Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -29,8 +29,8 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = i386-apple-darwin9.8.0
host_triplet = i386-apple-darwin9.8.0
build_triplet = x86_64-unknown-linux-gnu
host_triplet = x86_64-unknown-linux-gnu
subdir = perlmods
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@ -132,23 +132,23 @@ CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} /tmp/nagiosplugins/build-aux/missing --run aclocal-1.10
ACLOCAL = ${SHELL} /home/nagiosplugins/staging/nagiosplugins/build-aux/missing --run aclocal-1.10
ALLOCA =
ALLOCA_H = alloca.h
AMTAR = ${SHELL} /tmp/nagiosplugins/build-aux/missing --run tar
AMTAR = ${SHELL} /home/nagiosplugins/staging/nagiosplugins/build-aux/missing --run tar
APPLE_UNIVERSAL_BUILD = 0
AR = ar
ASM_SYMBOL_PREFIX = "_"
AUTOCONF = ${SHELL} /tmp/nagiosplugins/build-aux/missing --run autoconf
AUTOHEADER = ${SHELL} /tmp/nagiosplugins/build-aux/missing --run autoheader
AUTOMAKE = ${SHELL} /tmp/nagiosplugins/build-aux/missing --run automake-1.10
AWK = awk
ASM_SYMBOL_PREFIX = ""
AUTOCONF = ${SHELL} /home/nagiosplugins/staging/nagiosplugins/build-aux/missing --run autoconf
AUTOHEADER = ${SHELL} /home/nagiosplugins/staging/nagiosplugins/build-aux/missing --run autoheader
AUTOMAKE = ${SHELL} /home/nagiosplugins/staging/nagiosplugins/build-aux/missing --run automake-1.10
AWK = mawk
BASENAME = /usr/bin/basename
BITSIZEOF_PTRDIFF_T = 32
BITSIZEOF_SIG_ATOMIC_T = 32
BITSIZEOF_SIZE_T = 32
BITSIZEOF_WCHAR_T = 32
BITSIZEOF_WINT_T = 32
BITSIZEOF_PTRDIFF_T =
BITSIZEOF_SIG_ATOMIC_T =
BITSIZEOF_SIZE_T =
BITSIZEOF_WCHAR_T =
BITSIZEOF_WINT_T =
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
@ -158,12 +158,12 @@ CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DEPLIBS =
DSYMUTIL = dsymutil
DSYMUTIL =
DUMPBIN =
ECHO_C = \c
ECHO_N =
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = /usr/bin/grep -E
EGREP = /bin/grep -E
EMULTIHOP_HIDDEN =
EMULTIHOP_VALUE =
ENOLINK_HIDDEN =
@ -172,21 +172,21 @@ EOVERFLOW_HIDDEN =
EOVERFLOW_VALUE =
ERRNO_H =
EXEEXT =
EXTRAS = check_ldap check_mysql check_mysql_query check_procs check_nagios check_dns check_hpjd check_snmp check_by_ssh check_dig check_nt
EXTRAS = check_pgsql check_ldap check_ide_smart check_mysql check_mysql_query check_procs check_nagios check_dns check_hpjd check_snmp check_by_ssh check_swap check_dig check_apt check_nt
EXTRAS_ROOT =
EXTRA_NETOBJS =
EXTRA_TEST =
FGREP = /usr/bin/grep -F
FGREP = /bin/grep -F
FLOAT_H =
FLOORF_LIBM =
FLOORF_LIBM = -lm
GETADDRINFO_LIB =
GETHOSTNAME_LIB =
GETLOADAVG_LIBS =
GETOPT_H = getopt.h
GETTEXT_MACRO_VERSION = 0.18
GLIBC21 = no
GMSGFMT = /opt/local/bin/msgfmt
GMSGFMT_015 = /opt/local/bin/msgfmt
GLIBC21 = yes
GMSGFMT = /usr/bin/msgfmt
GMSGFMT_015 = /usr/bin/msgfmt
GNULIB_ACCEPT = 0
GNULIB_ACCEPT4 = 0
GNULIB_ACOSL = 0
@ -407,7 +407,7 @@ GNULIB_WCSRTOMBS = 0
GNULIB_WCTOB = 0
GNULIB_WCWIDTH = 0
GNULIB_WRITE = 1
GREP = /usr/bin/grep
GREP = /bin/grep
HAVE_ACCEPT4 = 1
HAVE_ACOSL = 1
HAVE_ARPA_INET_H = 1
@ -425,7 +425,7 @@ HAVE_DECL_ATANL = 1
HAVE_DECL_CEILF = 1
HAVE_DECL_CEILL = 1
HAVE_DECL_COSL = 1
HAVE_DECL_ENVIRON = 0
HAVE_DECL_ENVIRON = 1
HAVE_DECL_EXPL = 1
HAVE_DECL_FLOORF = 1
HAVE_DECL_FLOORL = 1
@ -456,8 +456,8 @@ HAVE_DECL_SINL = 1
HAVE_DECL_SNPRINTF = 1
HAVE_DECL_SQRTL = 1
HAVE_DECL_STRDUP = 1
HAVE_DECL_STRNDUP = 0
HAVE_DECL_STRNLEN = 0
HAVE_DECL_STRNDUP = 1
HAVE_DECL_STRNLEN = 1
HAVE_DECL_STRSIGNAL = 1
HAVE_DECL_STRTOK_R = 1
HAVE_DECL_TANL = 1
@ -550,9 +550,9 @@ HAVE_RENAMEAT = 1
HAVE_RPMATCH = 1
HAVE_SA_FAMILY_T = 1
HAVE_SETENV = 1
HAVE_SIGNED_SIG_ATOMIC_T = 1
HAVE_SIGNED_WCHAR_T = 1
HAVE_SIGNED_WINT_T = 1
HAVE_SIGNED_SIG_ATOMIC_T =
HAVE_SIGNED_WCHAR_T =
HAVE_SIGNED_WINT_T =
HAVE_SINL = 1
HAVE_SLEEP = 1
HAVE_SQRTL = 1
@ -568,13 +568,13 @@ HAVE_STRTOD = 1
HAVE_STRTOLL = 1
HAVE_STRTOULL = 1
HAVE_STRUCT_ADDRINFO = 1
HAVE_STRUCT_RANDOM_DATA = 0
HAVE_STRUCT_RANDOM_DATA = 1
HAVE_STRUCT_SOCKADDR_STORAGE = 1
HAVE_STRVERSCMP = 1
HAVE_SYMLINK = 1
HAVE_SYMLINKAT = 1
HAVE_SYS_BITYPES_H = 0
HAVE_SYS_INTTYPES_H = 0
HAVE_SYS_BITYPES_H =
HAVE_SYS_INTTYPES_H =
HAVE_SYS_LOADAVG_H = 0
HAVE_SYS_PARAM_H = 0
HAVE_SYS_SOCKET_H = 1
@ -613,10 +613,10 @@ INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
INTLLIBS =
INTL_MACOSX_LIBS = -Wl,-framework -Wl,CoreFoundation
INTL_MACOSX_LIBS =
KMEM_GROUP =
KRBINCLUDE =
LD = /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld
LD = /usr/bin/ld -m elf_x86_64
LDAPINCLUDE = -I/usr/include/ldap
LDAPLIBS = -lldap -llber
LDFLAGS = -L.
@ -625,29 +625,29 @@ LIBGNU_LIBDEPS =
LIBGNU_LTLIBDEPS =
LIBICONV = -liconv
LIBINTL =
LIBOBJS = ${LIBOBJDIR}error$U.o
LIBOBJS =
LIBS = -lpthread -ldl
LIBSOCKET =
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIPO = lipo
LIPO =
LN_S = ln -s
LOCALCHARSET_TESTS_ENVIRONMENT = CHARSETALIASDIR="$(top_builddir)/gl"
LOCALE_FR = fr_FR.ISO8859-1
LOCALE_FR_UTF8 = fr_FR.UTF-8
LOCALE_JA = ja_JP.eucJP
LOCALE_ZH_CN = zh_CN.GB18030
LOCALE_FR = none
LOCALE_FR_UTF8 = none
LOCALE_JA = none
LOCALE_ZH_CN = none
LTLIBICONV = -liconv
LTLIBINTL =
LTLIBOBJS = ${LIBOBJDIR}error$U.lo
MAKEINFO = ${SHELL} /tmp/nagiosplugins/build-aux/missing --run makeinfo
LTLIBOBJS =
MAKEINFO = ${SHELL} /home/nagiosplugins/staging/nagiosplugins/build-aux/missing --run makeinfo
MATHLIBS = -lm
MKDIR_P = ../build-aux/install-sh -c -d
MSGFMT = /opt/local/bin/msgfmt
MSGFMT_015 = /opt/local/bin/msgfmt
MSGMERGE = /opt/local/bin/msgmerge
MYSQLCFLAGS = -I/usr/local/mysql/include -Os -arch i386 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL
MYSQLINCLUDE = -I/usr/local/mysql/include
MYSQLLIBS = -L/usr/local/mysql/lib -lmysqlclient -lz -lm
MKDIR_P = /bin/mkdir -p
MSGFMT = /usr/bin/msgfmt
MSGFMT_015 = /usr/bin/msgfmt
MSGMERGE = /usr/bin/msgmerge
MYSQLCFLAGS = -I/usr/include/mysql -DBIG_JOINS=1 -fPIC
MYSQLINCLUDE = -I/usr/include/mysql
MYSQLLIBS = -L/usr/lib/mysql -lmysqlclient
NEED_SETGID = false
NETINET_IN_H =
NEXT_ARPA_INET_H = <arpa/inet.h>
@ -692,13 +692,13 @@ NEXT_TIME_H = <time.h>
NEXT_UNISTD_H = <unistd.h>
NEXT_WCHAR_H = <wchar.h>
NEXT_WCTYPE_H = <wctype.h>
NM = /usr/bin/nm -p
NMEDIT = nmedit
NM = /usr/bin/nm -B
NMEDIT =
NP_RELEASE = 1.4.15
OBJDUMP = false
OBJDUMP = objdump
OBJEXT = o
OTOOL = otool
OTOOL64 = :
OTOOL =
OTOOL64 =
PACKAGE = nagios-plugins
PACKAGE_BUGREPORT =
PACKAGE_NAME = nagios-plugins
@ -706,21 +706,21 @@ PACKAGE_STRING = nagios-plugins 1.4.15
PACKAGE_TARNAME = nagios-plugins
PACKAGE_VERSION = 1.4.15
PATH_SEPARATOR = :
PATH_TO_APTGET =
PATH_TO_APTGET = /usr/bin/apt-get
PATH_TO_DIG = /usr/bin/dig
PATH_TO_FPING =
PATH_TO_LMSTAT =
PATH_TO_LSPS =
PATH_TO_MAILQ = /usr/bin/mailq
PATH_TO_NSLOOKUP = /usr/bin/nslookup
PATH_TO_PING = /sbin/ping
PATH_TO_PING6 = /sbin/ping6
PATH_TO_PING = /bin/ping
PATH_TO_PING6 = /bin/ping6
PATH_TO_PS = /bin/ps
PATH_TO_QMAIL_QSTAT =
PATH_TO_QSTAT =
PATH_TO_QUAKESTAT =
PATH_TO_RPCINFO = /usr/sbin/rpcinfo
PATH_TO_SMBCLIENT = /usr/bin/smbclient
PATH_TO_RPCINFO = /usr/bin/rpcinfo
PATH_TO_SMBCLIENT =
PATH_TO_SNMPGET = /usr/bin/snmpget
PATH_TO_SNMPGETNEXT = /usr/bin/snmpgetnext
PATH_TO_SSH = /usr/bin/ssh
@ -730,11 +730,11 @@ PATH_TO_UPTIME = /usr/bin/uptime
PATH_TO_WHO = /usr/bin/who
PERL = /usr/bin/perl
PERLMODS_DIR =
PGINCLUDE =
PGLIBS =
PKG_ARCH = i386
PGINCLUDE = -I/usr/include/postgresql
PGLIBS = -L/lib -lpq -lcrypt
PKG_ARCH = unknown
PLUGIN_TEST = t/check_by_ssh.t t/check_cluster.t t/check_dig.t t/check_disk.t t/check_dns.t t/check_dummy.t t/check_fping.t t/check_ftp.t t/check_hpjd.t t/check_http.t t/check_imap.t t/check_jabber.t t/check_load.t t/check_mysql.t t/check_mysql_query.t t/check_nagios.t t/check_ntp.t t/check_ping.t t/check_pop.t t/check_procs.t t/check_smtp.t t/check_snmp.t t/check_swap.t t/check_tcp.t t/check_time.t t/check_udp.t t/check_users.t t/negate.t
POSUB =
POSUB = po
POW_LIB =
PRAGMA_SYSTEM_HEADER = #pragma GCC system_header
PST3CFLAGS =
@ -808,7 +808,7 @@ REPLACE_NANOSLEEP = GNULIB_PORTCHECK
REPLACE_NL_LANGINFO = 0
REPLACE_NULL = 0
REPLACE_OBSTACK_PRINTF = 0
REPLACE_OPEN = 1
REPLACE_OPEN = 0
REPLACE_OPENAT = 0
REPLACE_PERROR = 0
REPLACE_POPEN = 0
@ -825,13 +825,13 @@ REPLACE_RMDIR = 0
REPLACE_ROUND = 0
REPLACE_ROUNDF = 0
REPLACE_ROUNDL = 0
REPLACE_SETENV = 1
REPLACE_SETENV = 0
REPLACE_SIGNBIT = 0
REPLACE_SIGNBIT_USING_GCC = 0
REPLACE_SLEEP = 0
REPLACE_SNPRINTF = 0
REPLACE_SPRINTF = 0
REPLACE_STAT = 1
REPLACE_STAT = 0
REPLACE_STDIO_WRITE_FUNCS = 0
REPLACE_STPNCPY = 0
REPLACE_STRCASESTR = 0
@ -866,22 +866,22 @@ REPLACE_WCSRTOMBS = 0
REPLACE_WCTOB = 0
REPLACE_WCWIDTH = 0
REPLACE_WRITE = 0
REV_DATESTAMP = 2010.07.27.21.48
REV_TIMESTAMP = 20100727214823
SCRIPT_TEST = t/check_file_age.t t/check_ifoperstatus.t t/check_ifstatus.t t/check_rpc.t t/utils.t
SED = /usr/bin/sed
REV_DATESTAMP = 2012.06.11.23.00
REV_TIMESTAMP = 20120611230042
SCRIPT_TEST = t/check_disk_smb.t t/check_file_age.t t/check_ifoperstatus.t t/check_ifstatus.t t/check_rpc.t t/utils.t
SED = /bin/sed
SERVENT_LIB =
SET_MAKE =
SH = /bin/sh
SHELL = /bin/sh
SIG_ATOMIC_T_SUFFIX =
SIZE_T_SUFFIX = ul
SOCKETLIBS = -lresolv
SIZE_T_SUFFIX =
SOCKETLIBS = -lnsl -lresolv
SSLINCLUDE = -I/usr/include
SSLLIBS = -lssl -lcrypto
STDBOOL_H =
STDDEF_H =
STDINT_H = stdint.h
STDINT_H =
STRIP = strip
SUPPORT = Send email to nagios-users@lists.sourceforge.net if you have questions\nregarding use of this software. To submit patches or suggest improvements,\nsend email to nagiosplug-devel@lists.sourceforge.net.\nPlease include version information with all correspondence (when possible,\nuse output from the --version option of the plugin itself).\n
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = 0
@ -889,18 +889,18 @@ TIME_H_DEFINES_STRUCT_TIMESPEC = 1
UNDEFINE_STRTOK_R = 0
UNISTD_H_HAVE_WINSOCK2_H = 0
UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = 0
USE_NLS = no
USE_NLS = yes
VERSION = 1.4.15
WARRANTY = The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\ncopies of the plugins under the terms of the GNU General Public License.\nFor more information about these matters, see the file named COPYING.\n
WCHAR_T_SUFFIX =
WINT_T_SUFFIX =
XGETTEXT = /opt/local/bin/xgettext
XGETTEXT_015 = /opt/local/bin/xgettext
XGETTEXT = /usr/bin/xgettext
XGETTEXT_015 = /usr/bin/xgettext
XGETTEXT_EXTRA_OPTIONS = --flag=error:3:c-format --flag=error_at_line:5:c-format --flag=asprintf:2:c-format --flag=vasprintf:2:c-format
abs_builddir = /tmp/nagiosplugins/perlmods
abs_srcdir = /tmp/nagiosplugins/perlmods
abs_top_builddir = /tmp/nagiosplugins
abs_top_srcdir = /tmp/nagiosplugins
abs_builddir = /home/nagiosplugins/staging/nagiosplugins/perlmods
abs_srcdir = /home/nagiosplugins/staging/nagiosplugins/perlmods
abs_top_builddir = /home/nagiosplugins/staging/nagiosplugins
abs_top_srcdir = /home/nagiosplugins/staging/nagiosplugins
ac_ct_CC = gcc
ac_ct_DUMPBIN =
am__include = include
@ -909,11 +909,11 @@ am__quote =
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build = i386-apple-darwin9.8.0
build = x86_64-unknown-linux-gnu
build_alias =
build_cpu = i386
build_os = darwin9.8.0
build_vendor = apple
build_cpu = x86_64
build_os = linux-gnu
build_vendor = unknown
builddir = .
check_tcp_ssl = check_simap check_spop check_jabber check_nntps check_ssmtp
datadir = ${datarootdir}
@ -921,28 +921,28 @@ datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
dvidir = ${docdir}
exec_prefix = ${prefix}
gl_LIBOBJS = asnprintf.o basename.o basename-lgpl.o c-strtod.o cloexec.o creat-safer.o dirname.o dirname-lgpl.o dup-safer.o error.o fcntl.o fd-safer.o fsusage.o getopt.o getopt1.o mountlist.o open.o open-safer.o pipe-safer.o printf-args.o printf-parse.o regex.o safe-read.o safe-write.o setenv.o sha1.o stat.o stripslash.o strndup.o strnlen.o vasnprintf.o xmalloc.o
gl_LTLIBOBJS = asnprintf.lo basename.lo basename-lgpl.lo c-strtod.lo cloexec.lo creat-safer.lo dirname.lo dirname-lgpl.lo dup-safer.lo error.lo fcntl.lo fd-safer.lo fsusage.lo getopt.lo getopt1.lo mountlist.lo open.lo open-safer.lo pipe-safer.lo printf-args.lo printf-parse.lo regex.lo safe-read.lo safe-write.lo setenv.lo sha1.lo stat.lo stripslash.lo strndup.lo strnlen.lo vasnprintf.lo xmalloc.lo
gl_LIBOBJS = asnprintf.o basename.o basename-lgpl.o c-strtod.o cloexec.o creat-safer.o dirname.o dirname-lgpl.o dup-safer.o fcntl.o fd-safer.o fsusage.o getopt.o getopt1.o mountlist.o open-safer.o pipe-safer.o printf-args.o printf-parse.o regex.o safe-read.o safe-write.o sha1.o stripslash.o vasnprintf.o xmalloc.o
gl_LTLIBOBJS = asnprintf.lo basename.lo basename-lgpl.lo c-strtod.lo cloexec.lo creat-safer.lo dirname.lo dirname-lgpl.lo dup-safer.lo fcntl.lo fd-safer.lo fsusage.lo getopt.lo getopt1.lo mountlist.lo open-safer.lo pipe-safer.lo printf-args.lo printf-parse.lo regex.lo safe-read.lo safe-write.lo sha1.lo stripslash.lo vasnprintf.lo xmalloc.lo
gltests_LIBOBJS =
gltests_LTLIBOBJS =
gltests_WITNESS = IN_NAGIOS_PLUGINS_GNULIB_TESTS
host = i386-apple-darwin9.8.0
host = x86_64-unknown-linux-gnu
host_alias =
host_cpu = i386
host_os = darwin9.8.0
host_vendor = apple
host_cpu = x86_64
host_os = linux-gnu
host_vendor = unknown
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = $(SHELL) /tmp/nagiosplugins/build-aux/install-sh
install_sh = $(SHELL) /home/nagiosplugins/staging/nagiosplugins/build-aux/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
lt_ECHO = /bin/echo
lt_ECHO = echo
mandir = ${datarootdir}/man
mkdir_p = $(top_builddir)/build-aux/install-sh -c -d
np_mysql_config = /usr/local/mysql/bin/mysql_config
mkdir_p = /bin/mkdir -p
np_mysql_config = /usr/bin/mysql_config
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /usr/local/nagios

View file

@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

Binary file not shown.

Binary file not shown.

View file

@ -1,12 +1,12 @@
PKG="NAGplugin"
PKG="NGOSplugin"
NAME="nagios-plugins"
DESC="Nagios network monitoring plugins"
ARCH="i386"
VERSION="1.4.15,REV=2010.07.27.21.48"
ARCH="unknown"
VERSION="1.4.15,REV=2012.06.11.23.00"
CATEGORY="application"
VENDOR="Nagios Plugin Development Team"
EMAIL="nagiosplug-devel@lists.sourceforge.net"
PSTAMP="nag20100727214823"
PSTAMP="nag20120611230042"
BASEDIR="/"
CLASSES="none"

View file

@ -1,4 +1,4 @@
PKG="NAGplugin"
PKG="NGOSplugin"
NAME="nagios-plugins"
DESC="Nagios network monitoring plugins"
ARCH="@PKG_ARCH@"

35
pkg/solaris/preinstall Executable file
View file

@ -0,0 +1,35 @@
#!/usr/bin/sh
user="nagios"
uid=-1
group="nagios"
gid=-1
/usr/bin/getent group $group > /dev/null 2> /dev/null
result=$?
if [ $result -eq 2 ] ; then
echo "Group $group does not exist. Creating..."
if [ $gid -ne -1 ] ; then
/usr/sbin/groupadd -g $gid $group
else
/usr/sbin/groupadd $group
fi
elif [ $result -ne 0 ] ; then
echo "An error occurred determining the existence of the groug $group. Terminating."
exit 1;
fi
/usr/bin/getent passwd $user > /dev/null 2> /dev/null
result=$?
if [ $result -eq 2 ] ; then
echo "User $user does not exist. Creating..."
if [ $uid -ne -1 ] ; then
/usr/sbin/useradd -u $uid -g $group $user
else
/usr/sbin/useradd -g $group $user
fi
elif [ $result -ne 0 ] ; then
echo "An error occurred determining the existence of the user $user. Terminating."
exit 1;
fi

View file

@ -8,6 +8,7 @@ $pkgmk = "/usr/bin/pkgmk";
$pkgtrans = "/usr/bin/pkgtrans";
$prototype = "prototype";
$pkginfo = "pkginfo";
$preinstall = "preinstall";
$egrep = "/usr/bin/egrep";
# Sanity check
@ -24,17 +25,24 @@ open (PREPROTO,"$find . -print |$egrep -v \"^\.(/usr(/local)?|/opt)?\$\" | $pkgp
open (PROTO,">$prototype") ||
die "Unable to write file prototype ($!)\n";
print PROTO "i pkginfo=./$pkginfo\n";
print PROTO "i preinstall=./$preinstall\n";
while (<PREPROTO>) {
# Read in the prototype information
chomp;
$thisline = $_;
if ($thisline =~ " prototype "
or $thisline =~ " pkginfo ") {
or $thisline =~ " pkginfo "
or $thisline =~ " preinstall ") {
# Don't do anything as they aren't important
} elsif ($thisline =~ "pst3") {
# Needs to be installed SUID root
($dir, $none, $file, $mode, $user, $group) = split / /,$thisline;
print PROTO "$dir $none $file 4755 root bin\n";
} elsif ($thisline =~ "^[fd] ") {
# Change the ownership of files and directories
($dir, $none, $file, $mode, $user, $group) = split / /,$thisline;
print PROTO "$dir $none $file $mode bin bin\n";
print PROTO "$dir $none $file $mode $user bin\n";
} else {
# Symlinks and other stuff should be printed also
print PROTO "$thisline\n";
@ -58,6 +66,7 @@ while (<PKGINFO>) {
$thisline = $_;
($var,$value) = split /=/,$thisline;
if ("$var" eq "NAME"
or "$var" eq "PKG"
or "$var" eq "VERSION"
or "$var" eq "ARCH") {
$tmp = lc($var);
@ -77,5 +86,5 @@ $packagename = "$name-$version-$os-$arch-local";
print "Building package\n";
system ("$pkgmk -o -r `pwd` -d $pkgdevice");
system ("(cd $pkgdevice && $pkgtrans -s `pwd` ../$packagename)");
system ("(cd $pkgdevice && $pkgtrans -s `pwd` ../$packagename $pkg)");
print "Done. ($packagename)\n";

View file

@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -147,7 +147,7 @@ pst3_LDADD = $(LDADD)
pst3_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(pst3_CFLAGS) $(CFLAGS) $(pst3_LDFLAGS) \
$(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@ -1133,8 +1133,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@ -1146,8 +1146,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@ -1157,13 +1157,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique

View file

@ -621,7 +621,7 @@ main(int argc, char **argv)
}
host = list;
table = malloc(sizeof(struct rta_host **) * (argc - 1));
table = malloc(sizeof(struct rta_host **) * targets);
i = 0;
while(host) {
host->id = i*packets;

View file

@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

View file

@ -67,7 +67,7 @@ my $host = $1 if ($opt_H =~ /^([-_.A-Za-z0-9 ]+\$?)$/);
($host) || usage("Invalid host: $opt_H\n");
($opt_s) || ($opt_s = shift @ARGV) || usage("Share volume not specified\n");
my $share = $1 if ($opt_s =~ /^([-_.A-Za-z0-9]+\$?)$/);
my $share = $1 if ($opt_s =~ /^([-_.A-Za-z0-9 ]+\$?)$/);
($share) || usage("Invalid share: $opt_s\n");
defined($opt_u) || ($opt_u = shift @ARGV) || ($opt_u = "guest");
@ -239,7 +239,7 @@ if (/\s*(\d*) blocks of size (\d*)\. (\d*) blocks available/) {
$answer = "Result from smbclient not suitable\n";
$state = "UNKNOWN";
foreach (@lines) {
if (/(Access denied|NT_STATUS_LOGON_FAILURE)/) {
if (/(Access denied|NT_STATUS_LOGON_FAILURE|NT_STATUS_ACCESS_DENIED)/) {
$answer = "Access Denied\n";
$state = "CRITICAL";
last;

View file

@ -10,7 +10,7 @@ REVISION="@NP_VERSION@"
print_usage() {
echo "Usage: $PROGNAME"
echo "Usage: $PROGNAME" [--ignore-fault]
}
print_help() {
@ -21,25 +21,25 @@ print_help() {
echo "This plugin checks hardware status using the lm_sensors package."
echo ""
support
exit 0
exit $STATE_OK
}
case "$1" in
--help)
print_help
exit 0
exit $STATE_OK
;;
-h)
print_help
exit 0
exit $STATE_OK
;;
--version)
print_revision $PROGNAME $REVISION
exit 0
print_revision $PROGNAME $REVISION
exit $STATE_OK
;;
-V)
print_revision $PROGNAME $REVISION
exit 0
exit $STATE_OK
;;
*)
sensordata=`sensors 2>&1`
@ -49,17 +49,20 @@ case "$1" in
fi
if test ${status} -eq 127; then
echo "SENSORS UNKNOWN - command not found (did you install lmsensors?)"
exit -1
elif test ${status} -ne 0 ; then
exit $STATE_UNKNOWN
elif test ${status} -ne 0; then
echo "WARNING - sensors returned state $status"
exit 1
exit $STATE_WARNING
fi
if echo ${sensordata} | egrep ALARM > /dev/null; then
echo SENSOR CRITICAL - Sensor alarm detected!
exit 2
else
echo sensor ok
exit 0
exit $STATE_CRITICAL
elif echo ${sensordata} | egrep FAULT > /dev/null \
&& test "$1" != "-i" -a "$1" != "--ignore-fault"; then
echo SENSOR UNKNOWN - Sensor reported fault
exit $STATE_UNKNOWN
fi
echo sensor ok
exit $STATE_OK
;;
esac

View file

@ -0,0 +1,96 @@
#! /usr/bin/perl -w -I ..
#
# test cases for check_disk_smb
#
use strict;
use Test::More;
use NPTest;
my $tests = 14;
plan tests => $tests;
my $res;
my $plugin = "check_disk_smb";
SKIP: {
skip "$plugin is not created", $tests if ( ! -x $plugin );
my $auth = "";
my $host = getTestParameter("NP_HOST_SMB", "A host providing an SMB Service",
"localhost");
my $smb_share = getTestParameter("NP_SMB_SHARE",
"An SMB share name the host provides",
"public");
my $smb_share_spc = getTestParameter("NP_SMB_SHARE_SPC",
"An SMB share name containing one or more spaces the host provides",
"pub lic");
my $smb_share_deny = getTestParameter("NP_SMB_SHARE_DENY",
"An access denying SMB share name the host provides",
"private");
my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE",
"The hostname of system not responsive to network requests", "10.0.0.1" );
my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID",
"An invalid (not known to DNS) hostname",
"nosuchhost" );
my $user = getTestParameter( "NP_SMB_VALID_USER", "A valid smb user", "" );
my $pass = getTestParameter( "NP_SMB_VALID_USER_PASS", "A valid password for valid smb user", "" );
$auth .= "-u $user " if ($user);
$auth .= "-p $pass " if ($pass);
$res = NPTest->testCmd( "./$plugin" );
is( $res->return_code, 3, "No arguments" );
$res = NPTest->testCmd( "./$plugin -H fakehostname" );
is( $res->return_code, 3, "No share specified" );
$res = NPTest->testCmd( "./$plugin -H fakehostname -s share -w 100G -c 101G" );
is( $res->return_code, 3, "warn is less than critical" );
SKIP: {
skip "no smb host defined", 6 if ( ! $host );
SKIP: {
skip "no share name defined", 2 if ( ! $smb_share );
$res = NPTest->testCmd( "./$plugin -H $host $auth -s $smb_share -w 2k -c 1k" );
cmp_ok( $res->return_code, '==', 0, "Exit OK if $smb_share has > 1k free space");
like($res->output, '/free/i', "String contains the word 'free'");
$res = NPTest->testCmd( "./$plugin -H $host $auth -s $smb_share -w 10001G -c 10000G" );
cmp_ok( $res->return_code, '==', 2, "Exit CRIT if $smb_share has < 10000G free space");
like($res->output, '/free/i', "String contains the word 'free'");
$res = NPTest->testCmd( "./$plugin -H $host $auth -s $smb_share -w 10000G -c 1k" );
cmp_ok( $res->return_code, '==', 1, "Exit WARN if $smb_share has > 10000G and <1k free space");
like($res->output, '/free/i', "String contains the word 'free'");
}
SKIP: {
skip "no share name containing spaces defined", 2 if ( ! $smb_share_spc );
$res = NPTest->testCmd( "./$plugin -H $host $auth -s '$smb_share_spc' -w 2k -c 1k" );
cmp_ok( $res->return_code, '==', 0, "Exit OK if '$smb_share_spc' has > 1k free space");
like($res->output, '/free/i', "String contains the word 'free'");
}
SKIP: {
skip "no share name without permissions ", 2 if ( ! $smb_share_deny );
$res = NPTest->testCmd( "./$plugin -H $host $auth -s $smb_share_deny -w 2k -c 1k" );
cmp_ok( $res->return_code, '==', 2, "Exit CRIT if $smb_share_deny has > 1k free space");
unlike($res->output, '/free/i', "String does not contain the word 'free'");
}
}
SKIP: {
skip "no non responsive host defined", 1 if ( ! $host_nonresponsive );
$res = NPTest->testCmd( "./$plugin -H $host_nonresponsive -s np_foobar ");
cmp_ok( $res->return_code, '==', 3, "Exit UNKNOWN with non responsive host" );
}
}

View file

@ -21,3 +21,88 @@ support() {
$ECHO "@SUPPORT@" | sed -e 's/\n/ /g'
}
#
# check_range takes a value and a range string, returning successfully if an
# alert should be raised based on the range.
#
check_range() {
local v range yes no err decimal start end cmp match
v="$1"
range="$2"
# whether to raise an alert or not
yes=0
no=1
err=2
# regex to match a decimal number
decimal="-?([0-9]+\.?[0-9]*|[0-9]*\.[0-9]+)"
# compare numbers (including decimals), returning true/false
cmp() { awk "BEGIN{ if ($1) exit(0); exit(1)}"; }
# returns successfully if the string in the first argument matches the
# regex in the second
match() { echo "$1" | grep -E -q -- "$2"; }
# make sure value is valid
if ! match "$v" "^$decimal$"; then
echo "${0##*/}: check_range: invalid value" >&2
unset -f cmp match
return "$err"
fi
# make sure range is valid
if ! match "$range" "^@?(~|$decimal)(:($decimal)?)?$"; then
echo "${0##*/}: check_range: invalid range" >&2
unset -f cmp match
return "$err"
fi
# check for leading @ char, which negates the range
if match $range '^@'; then
range=${range#@}
yes=1
no=0
fi
# parse the range string
if ! match "$range" ':'; then
start=0
end="$range"
else
start="${range%%:*}"
end="${range#*:}"
fi
# do the comparison, taking positive ("") and negative infinity ("~")
# into account
if [ "$start" != "~" ] && [ "$end" != "" ]; then
if cmp "$start <= $v" && cmp "$v <= $end"; then
unset -f cmp match
return "$no"
else
unset -f cmp match
return "$yes"
fi
elif [ "$start" != "~" ] && [ "$end" = "" ]; then
if cmp "$start <= $v"; then
unset -f cmp match
return "$no"
else
unset -f cmp match
return "$yes"
fi
elif [ "$start" = "~" ] && [ "$end" != "" ]; then
if cmp "$v <= $end"; then
unset -f cmp match
return "$no"
else
unset -f cmp match
return "$yes"
fi
else
unset -f cmp match
return "$no"
fi
}

View file

@ -101,7 +101,7 @@ check_tcp_LDADD = $(SSLOBJS) $(NETLIBS) $(SSLLIBS)
check_time_LDADD = $(NETLIBS)
check_ntp_time_LDADD = $(NETLIBS) $(MATHLIBS)
check_ups_LDADD = $(NETLIBS)
check_users_LDADD = $(BASEOBJS) popen.o
check_users_LDADD = $(BASEOBJS)
check_by_ssh_LDADD = $(NETLIBS)
check_ide_smart_LDADD = $(BASEOBJS)
negate_LDADD = $(BASEOBJS)

View file

@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -239,7 +239,7 @@ negate_SOURCES = negate.c
negate_OBJECTS = negate.$(OBJEXT)
urlize_SOURCES = urlize.c
urlize_OBJECTS = urlize.$(OBJEXT)
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@ -1159,7 +1159,7 @@ check_tcp_LDADD = $(SSLOBJS) $(NETLIBS) $(SSLLIBS)
check_time_LDADD = $(NETLIBS)
check_ntp_time_LDADD = $(NETLIBS) $(MATHLIBS)
check_ups_LDADD = $(NETLIBS)
check_users_LDADD = $(BASEOBJS) popen.o
check_users_LDADD = $(BASEOBJS)
check_by_ssh_LDADD = $(NETLIBS)
check_ide_smart_LDADD = $(BASEOBJS)
negate_LDADD = $(BASEOBJS)
@ -1246,8 +1246,8 @@ install-libexecPROGRAMS: $(libexec_PROGRAMS)
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \
else :; fi; \
done
@ -1493,8 +1493,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@ -1506,8 +1506,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@ -1517,13 +1517,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique

View file

@ -187,6 +187,7 @@ process_arguments (int argc, char **argv)
{"use-ipv6", no_argument, 0, '6'},
{"ssh-option", required_argument, 0, 'o'},
{"quiet", no_argument, 0, 'q'},
{"configfile", optional_argument, 0, 'F'},
{0, 0, 0, 0}
};
@ -198,7 +199,7 @@ process_arguments (int argc, char **argv)
strcpy (argv[c], "-t");
while (1) {
c = getopt_long (argc, argv, "Vvh1246fqt:H:O:p:i:u:l:C:S::E::n:s:o:", longopts,
c = getopt_long (argc, argv, "Vvh1246fqt:H:O:p:i:u:l:C:S::E::n:s:o:F:", longopts,
&option);
if (c == -1 || c == EOF)
@ -306,6 +307,10 @@ process_arguments (int argc, char **argv)
case 'q': /* Tell the ssh command to be quiet */
comm_append("-q");
break;
case 'F': /* ssh configfile */
comm_append("-F");
comm_append(optarg);
break;
default: /* help */
usage5();
}
@ -418,6 +423,8 @@ print_help (void)
printf (" %s\n", _("short name of host in nagios configuration [optional]"));
printf (" %s\n","-o, --ssh-option=OPTION");
printf (" %s\n", _("Call ssh with '-o OPTION' (may be used multiple times) [optional]"));
printf (" %s\n","-F, --configfile");
printf (" %s\n", _("Tell ssh to use this configfile [optional]"));
printf (" %s\n","-q, --quiet");
printf (" %s\n", _("Tell ssh to suppress warning and diagnostic messages [optional]"));
printf (UT_WARN_CRIT);
@ -454,6 +461,6 @@ print_usage (void)
printf (" %s -H <host> -C <command> [-fqv] [-1|-2] [-4|-6]\n"
" [-S [lines]] [-E [lines]] [-t timeout] [-i identity]\n"
" [-l user] [-n name] [-s servicelist] [-O outputfile]\n"
" [-p port] [-o ssh-option]\n",
" [-p port] [-o ssh-option] [-F configfile]\n",
progname);
}

View file

@ -122,6 +122,8 @@ void print_help (void);
void print_usage (void);
double calculate_percent(uintmax_t, uintmax_t);
void stat_path (struct parameter_list *p);
void get_stats (struct parameter_list *p, struct fs_usage *fsp);
void get_path_stats (struct parameter_list *p, struct fs_usage *fsp);
double w_dfp = -1.0;
double c_dfp = -1.0;
@ -148,6 +150,7 @@ char *crit_freeinodes_percent = NULL;
int path_selected = FALSE;
char *group = NULL;
struct stat *stat_buf;
struct name_list *seen = NULL;
int
@ -160,10 +163,6 @@ main (int argc, char **argv)
char *perf;
char *preamble;
double inode_space_pct;
uintmax_t total, available, available_to_root, used;
double dfree_pct = -1, dused_pct = -1;
double dused_units, dfree_units, dtotal_units;
double dused_inodes_percent, dfree_inodes_percent;
double warning_high_tide;
double critical_high_tide;
int temp_result;
@ -171,7 +170,6 @@ main (int argc, char **argv)
struct mount_entry *me;
struct fs_usage fsp, tmpfsp;
struct parameter_list *temp_list, *path;
struct name_list *seen = NULL;
preamble = strdup (" - free space:");
output = strdup ("");
@ -237,45 +235,8 @@ main (int argc, char **argv)
/* Remove filesystems already seen */
if (np_seen_name(seen, me->me_mountdir)) {
continue;
} else {
if (path->group != NULL) {
/* find all group members */
fsp.fsu_blocksize = 0;
fsp.fsu_blocks = 0;
fsp.fsu_bfree = 0;
fsp.fsu_bavail = 0;
fsp.fsu_files = 0;
fsp.fsu_ffree = 0;
for (temp_list = path_select_list; temp_list; temp_list=temp_list->name_next) {
if (temp_list->group && ! (strcmp(temp_list->group, path->group))) {
stat_path(path);
get_fs_usage (temp_list->best_match->me_mountdir, temp_list->best_match->me_devname, &tmpfsp);
/* possibly differing blocksizes if disks are grouped. Calculating average */
fsp.fsu_blocksize = (fsp.fsu_blocksize * fsp.fsu_blocks + tmpfsp.fsu_blocksize * tmpfsp.fsu_blocks) / \
(fsp.fsu_blocks + tmpfsp.fsu_blocks); /* Size of a block. */
fsp.fsu_blocks += tmpfsp.fsu_blocks; /* Total blocks. */
fsp.fsu_bfree += tmpfsp.fsu_bfree; /* Free blocks available to superuser. */
/* Gnulib workaround - see comment about it a few lines below */
fsp.fsu_bavail += (tmpfsp.fsu_bavail > tmpfsp.fsu_bfree ? 0 : tmpfsp.fsu_bavail); /* Free blocks available to non-superuser. */
fsp.fsu_files += tmpfsp.fsu_files; /* Total file nodes. */
fsp.fsu_ffree += tmpfsp.fsu_ffree; /* Free file nodes. */
if (verbose >= 3)
printf("Group %s: add %llu blocks (%s) \n", path->group, tmpfsp.fsu_bavail, temp_list->name);
/* printf("Group %s: add %u blocks (%s)\n", temp_list->name); *//* path->group, tmpfsp.fsu_bavail, temp_list->name); */
np_add_name(&seen, temp_list->best_match->me_mountdir);
}
}
/* modify devname and mountdir for output */
me->me_mountdir = me->me_devname = path->group;
} else
np_add_name(&seen, me->me_mountdir);
}
}
np_add_name(&seen, me->me_mountdir);
if (path->group == NULL) {
/* Skip remote filesystems if we're not interested in them */
@ -301,55 +262,36 @@ main (int argc, char **argv)
}
if (fsp.fsu_blocks && strcmp ("none", me->me_mountdir)) {
total = fsp.fsu_blocks;
/* 2007-12-08 - Workaround for Gnulib reporting insanely high available
* space on BSD (the actual value should be negative but fsp.fsu_bavail
* is unsigned) */
available = fsp.fsu_bavail > fsp.fsu_bfree ? 0 : fsp.fsu_bavail;
available_to_root = fsp.fsu_bfree;
used = total - available_to_root;
if (verbose >= 3)
printf ("For %s, total=%llu, available=%llu, available_to_root=%llu, used=%llu, fsp.fsu_files=%llu, fsp.fsu_ffree=%llu\n",
me->me_mountdir, total, available, available_to_root, used, fsp.fsu_files, fsp.fsu_ffree);
dused_pct = calculate_percent( used, used + available ); /* used + available can never be > uintmax */
dfree_pct = 100 - dused_pct;
dused_units = used*fsp.fsu_blocksize/mult;
dfree_units = available*fsp.fsu_blocksize/mult;
dtotal_units = total*fsp.fsu_blocksize/mult;
dused_inodes_percent = calculate_percent(fsp.fsu_files - fsp.fsu_ffree, fsp.fsu_files);
dfree_inodes_percent = 100 - dused_inodes_percent;
get_stats (path, &fsp);
if (verbose >= 3) {
printf ("For %s, used_pct=%g free_pct=%g used_units=%g free_units=%g total_units=%g used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n",
me->me_mountdir, dused_pct, dfree_pct, dused_units, dfree_units, dtotal_units, dused_inodes_percent, dfree_inodes_percent, fsp.fsu_blocksize, mult);
me->me_mountdir, path->dused_pct, path->dfree_pct, path->dused_units, path->dfree_units, path->dtotal_units, path->dused_inodes_percent, path->dfree_inodes_percent, fsp.fsu_blocksize, mult);
}
/* Threshold comparisons */
temp_result = get_status(dfree_units, path->freespace_units);
temp_result = get_status(path->dfree_units, path->freespace_units);
if (verbose >=3) printf("Freespace_units result=%d\n", temp_result);
disk_result = max_state( disk_result, temp_result );
temp_result = get_status(dfree_pct, path->freespace_percent);
temp_result = get_status(path->dfree_pct, path->freespace_percent);
if (verbose >=3) printf("Freespace%% result=%d\n", temp_result);
disk_result = max_state( disk_result, temp_result );
temp_result = get_status(dused_units, path->usedspace_units);
temp_result = get_status(path->dused_units, path->usedspace_units);
if (verbose >=3) printf("Usedspace_units result=%d\n", temp_result);
disk_result = max_state( disk_result, temp_result );
temp_result = get_status(dused_pct, path->usedspace_percent);
temp_result = get_status(path->dused_pct, path->usedspace_percent);
if (verbose >=3) printf("Usedspace_percent result=%d\n", temp_result);
disk_result = max_state( disk_result, temp_result );
temp_result = get_status(dused_inodes_percent, path->usedinodes_percent);
temp_result = get_status(path->dused_inodes_percent, path->usedinodes_percent);
if (verbose >=3) printf("Usedinodes_percent result=%d\n", temp_result);
disk_result = max_state( disk_result, temp_result );
temp_result = get_status(dfree_inodes_percent, path->freeinodes_percent);
temp_result = get_status(path->dfree_inodes_percent, path->freeinodes_percent);
if (verbose >=3) printf("Freeinodes_percent result=%d\n", temp_result);
disk_result = max_state( disk_result, temp_result );
@ -365,26 +307,26 @@ main (int argc, char **argv)
critical_high_tide = UINT_MAX;
if (path->freespace_units->warning != NULL) {
warning_high_tide = dtotal_units - path->freespace_units->warning->end;
warning_high_tide = path->dtotal_units - path->freespace_units->warning->end;
}
if (path->freespace_percent->warning != NULL) {
warning_high_tide = abs( min( (double) warning_high_tide, (double) (1.0 - path->freespace_percent->warning->end/100)*dtotal_units ));
warning_high_tide = abs( min( (double) warning_high_tide, (double) (1.0 - path->freespace_percent->warning->end/100)*path->dtotal_units ));
}
if (path->freespace_units->critical != NULL) {
critical_high_tide = dtotal_units - path->freespace_units->critical->end;
critical_high_tide = path->dtotal_units - path->freespace_units->critical->end;
}
if (path->freespace_percent->critical != NULL) {
critical_high_tide = abs( min( (double) critical_high_tide, (double) (1.0 - path->freespace_percent->critical->end/100)*dtotal_units ));
critical_high_tide = abs( min( (double) critical_high_tide, (double) (1.0 - path->freespace_percent->critical->end/100)*path->dtotal_units ));
}
/* Nb: *_high_tide are unset when == UINT_MAX */
asprintf (&perf, "%s %s", perf,
perfdata ((!strcmp(me->me_mountdir, "none") || display_mntp) ? me->me_devname : me->me_mountdir,
dused_units, units,
path->dused_units, units,
(warning_high_tide != UINT_MAX ? TRUE : FALSE), warning_high_tide,
(critical_high_tide != UINT_MAX ? TRUE : FALSE), critical_high_tide,
TRUE, 0,
TRUE, dtotal_units));
TRUE, path->dtotal_units));
if (disk_result==STATE_OK && erronly && !verbose)
continue;
@ -392,13 +334,13 @@ main (int argc, char **argv)
asprintf (&output, "%s %s %.0f %s (%.0f%%",
output,
(!strcmp(me->me_mountdir, "none") || display_mntp) ? me->me_devname : me->me_mountdir,
dfree_units,
path->dfree_units,
units,
dfree_pct);
if (dused_inodes_percent < 0) {
path->dfree_pct);
if (path->dused_inodes_percent < 0) {
asprintf(&output, "%s inode=-);", output);
} else {
asprintf(&output, "%s inode=%.0f%%);", output, dfree_inodes_percent );
asprintf(&output, "%s inode=%.0f%%);", output, path->dfree_inodes_percent );
}
/* TODO: Need to do a similar debug line
@ -996,3 +938,74 @@ stat_path (struct parameter_list *p)
die (STATE_CRITICAL, _("%s %s: %s\n"), p->name, _("is not accessible"), strerror(errno));
}
}
void
get_stats (struct parameter_list *p, struct fs_usage *fsp) {
struct parameter_list *p_list;
struct fs_usage tmpfsp;
int first = 1;
if (p->group == NULL) {
get_path_stats(p,fsp);
} else {
/* find all group members */
for (p_list = path_select_list; p_list; p_list=p_list->name_next) {
if (p_list->group && ! (strcmp(p_list->group, p->group))) {
stat_path(p_list);
get_fs_usage (p_list->best_match->me_mountdir, p_list->best_match->me_devname, &tmpfsp);
get_path_stats(p_list, &tmpfsp);
if (verbose >= 3)
printf("Group %s: adding %llu blocks sized %llu, (%s) used_units=%g free_units=%g total_units=%g fsu_blocksize=%llu mult=%llu\n",
p_list->group, tmpfsp.fsu_bavail, tmpfsp.fsu_blocksize, p_list->best_match->me_mountdir, p_list->dused_units, p_list->dfree_units,
p_list->dtotal_units, mult);
/* prevent counting the first FS of a group twice since its parameter_list entry
* is used to carry the information of all file systems of the entire group */
if (! first) {
p->total += p_list->total;
p->available += p_list->available;
p->available_to_root += p_list->available_to_root;
p->used += p_list->used;
p->dused_units += p_list->dused_units;
p->dfree_units += p_list->dfree_units;
p->dtotal_units += p_list->dtotal_units;
p->inodes_total += p_list->inodes_total;
p->inodes_free += p_list->inodes_free;
}
first = 0;
}
if (verbose >= 3)
printf("Group %s now has: used_units=%g free_units=%g total_units=%g fsu_blocksize=%llu mult=%llu\n",
p->group, tmpfsp.fsu_bavail, tmpfsp.fsu_blocksize, p->best_match->me_mountdir, p->dused_units,
p->dfree_units, p->dtotal_units, mult);
}
/* modify devname and mountdir for output */
p->best_match->me_mountdir = p->best_match->me_devname = p->group;
}
/* finally calculate percentages for either plain FS or summed up group */
p->dused_pct = calculate_percent( p->used, p->used + p->available ); /* used + available can never be > uintmax */
p->dfree_pct = 100 - p->dused_pct;
p->dused_inodes_percent = calculate_percent(p->inodes_total - p->inodes_free, p->inodes_total);
p->dfree_inodes_percent = 100 - p->dused_inodes_percent;
}
void
get_path_stats (struct parameter_list *p, struct fs_usage *fsp) {
p->total = fsp->fsu_blocks;
/* 2007-12-08 - Workaround for Gnulib reporting insanely high available
* space on BSD (the actual value should be negative but fsp->fsu_bavail
* is unsigned) */
p->available = fsp->fsu_bavail > fsp->fsu_bfree ? 0 : fsp->fsu_bavail;
p->available_to_root = fsp->fsu_bfree;
p->used = p->total - p->available_to_root;
p->dused_units = p->used*fsp->fsu_blocksize/mult;
p->dfree_units = p->available*fsp->fsu_blocksize/mult;
p->dtotal_units = p->total*fsp->fsu_blocksize/mult;
p->inodes_total = fsp->fsu_files; /* Total file nodes. */
p->inodes_free = fsp->fsu_ffree; /* Free file nodes. */
np_add_name(&seen, p->best_match->me_mountdir);
}

View file

@ -34,7 +34,7 @@
/* splint -I. -I../../plugins -I../../lib/ -I/usr/kerberos/include/ ../../plugins/check_http.c */
const char *progname = "check_http";
const char *copyright = "1999-2008";
const char *copyright = "1999-2011";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
#include "common.h"
@ -59,6 +59,7 @@ enum {
#ifdef HAVE_SSL
int check_cert = FALSE;
int days_till_exp;
int ssl_version;
char *randbuff;
X509 *server_cert;
# define my_recv(buf, len) ((use_ssl) ? np_net_ssl_read(buf, len) : read(sd, buf, len))
@ -101,10 +102,9 @@ int server_expect_yn = 0;
char server_expect[MAX_INPUT_BUFFER] = HTTP_EXPECT;
char string_expect[MAX_INPUT_BUFFER] = "";
char output_string_search[30] = "";
double warning_time = 0;
int check_warning_time = FALSE;
double critical_time = 0;
int check_critical_time = FALSE;
char *warning_thresholds = NULL;
char *critical_thresholds = NULL;
thresholds *thlds;
char user_auth[MAX_INPUT_BUFFER] = "";
char proxy_auth[MAX_INPUT_BUFFER] = "";
int display_html = FALSE;
@ -189,7 +189,7 @@ process_arguments (int argc, char **argv)
STD_LONG_OPTS,
{"link", no_argument, 0, 'L'},
{"nohtml", no_argument, 0, 'n'},
{"ssl", no_argument, 0, 'S'},
{"ssl", optional_argument, 0, 'S'},
{"sni", no_argument, 0, SNI_OPTION},
{"post", required_argument, 0, 'P'},
{"method", required_argument, 0, 'j'},
@ -235,7 +235,7 @@ process_arguments (int argc, char **argv)
}
while (1) {
c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:j:T:I:a:b:e:p:s:R:r:u:f:C:nlLSm:M:N", longopts, &option);
c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:j:T:I:a:b:e:p:s:R:r:u:f:C:nlLS::m:M:N", longopts, &option);
if (c == -1 || c == EOF)
break;
@ -258,20 +258,10 @@ process_arguments (int argc, char **argv)
socket_timeout = atoi (optarg);
break;
case 'c': /* critical time threshold */
if (!is_nonnegative (optarg))
usage2 (_("Critical threshold must be integer"), optarg);
else {
critical_time = strtod (optarg, NULL);
check_critical_time = TRUE;
}
critical_thresholds = optarg;
break;
case 'w': /* warning time threshold */
if (!is_nonnegative (optarg))
usage2 (_("Warning threshold must be integer"), optarg);
else {
warning_time = strtod (optarg, NULL);
check_warning_time = TRUE;
}
warning_thresholds = optarg;
break;
case 'A': /* User Agent String */
asprintf (&user_agent, "User-Agent: %s", optarg);
@ -305,6 +295,13 @@ process_arguments (int argc, char **argv)
usage4 (_("Invalid option - SSL is not available"));
#endif
use_ssl = TRUE;
if (optarg == NULL || c != 'S')
ssl_version = 0;
else {
ssl_version = atoi(optarg);
if (ssl_version < 1 || ssl_version > 3)
usage4 (_("Invalid option - Valid values for SSL Version are 1 (TLSv1), 2 (SSLv2) or 3 (SSLv3)"));
}
if (specify_port == FALSE)
server_port = HTTPS_PORT;
break;
@ -478,8 +475,10 @@ process_arguments (int argc, char **argv)
server_address = strdup (host_name);
}
if (check_critical_time && critical_time>(double)socket_timeout)
socket_timeout = (int)critical_time + 1;
set_thresholds(&thlds, warning_thresholds, critical_thresholds);
if (critical_thresholds && thlds->critical->end>(double)socket_timeout)
socket_timeout = (int)thlds->critical->end + 1;
if (http_method == NULL)
http_method = strdup ("GET");
@ -807,7 +806,9 @@ check_http (void)
die (STATE_CRITICAL, _("HTTP CRITICAL - Unable to open TCP socket\n"));
#ifdef HAVE_SSL
if (use_ssl == TRUE) {
np_net_ssl_init_with_hostname(sd, (use_sni ? host_name : NULL));
result = np_net_ssl_init_with_hostname_and_version(sd, (use_sni ? host_name : NULL), ssl_version);
if (result != STATE_OK)
return result;
if (check_cert == TRUE) {
result = np_net_ssl_check_cert(days_till_exp);
np_net_ssl_cleanup();
@ -1099,10 +1100,7 @@ check_http (void)
(display_html ? "</A>" : ""),
perfd_time (elapsed_time), perfd_size (page_len));
if (check_critical_time == TRUE && elapsed_time > critical_time)
result = STATE_CRITICAL;
if (check_warning_time == TRUE && elapsed_time > warning_time)
result = max_state_alt(STATE_WARNING, result);
result = max_state_alt(get_status(elapsed_time, thlds), result);
die (result, "HTTP %s: %s\n", state_text(result), msg);
/* die failed? */
@ -1284,8 +1282,8 @@ server_port_check (int ssl_flag)
char *perfd_time (double elapsed_time)
{
return fperfdata ("time", elapsed_time, "s",
check_warning_time, warning_time,
check_critical_time, critical_time,
thlds->warning?TRUE:FALSE, thlds->warning?thlds->warning->end:0,
thlds->critical?TRUE:FALSE, thlds->critical?thlds->critical->end:0,
TRUE, 0, FALSE, 0);
}
@ -1335,13 +1333,14 @@ print_help (void)
printf (UT_IPv46);
#ifdef HAVE_SSL
printf (" %s\n", "-S, --ssl");
printf (" %s\n", _("Connect via SSL. Port defaults to 443"));
printf (" %s\n", "-S, --ssl=VERSION");
printf (" %s\n", _("Connect via SSL. Port defaults to 443. VERSION is optional, and prevents"));
printf (" %s\n", _("auto-negotiation (1 = TLSv1, 2 = SSLv2, 3 = SSLv3)."));
printf (" %s\n", "--sni");
printf (" %s\n", _("Enable SSL/TLS hostname extension support (SNI)"));
printf (" %s\n", _("Enable SSL/TLS hostname extension support (SNI)"));
printf (" %s\n", "-C, --certificate=INTEGER");
printf (" %s\n", _("Minimum number of days a certificate has to be valid. Port defaults to 443"));
printf (" %s\n", _("(when this option is used the URL is not checked.)\n"));
printf (" %s\n", _("Minimum number of days a certificate has to be valid. Port defaults to 443"));
printf (" %s\n", _("(when this option is used the URL is not checked.)\n"));
#endif
printf (" %s\n", "-e, --expect=STRING");
@ -1378,16 +1377,16 @@ print_help (void)
printf (" %s\n", "-a, --authorization=AUTH_PAIR");
printf (" %s\n", _("Username:password on sites with basic authentication"));
printf (" %s\n", "-b, --proxy-authorization=AUTH_PAIR");
printf (" %s\n", _("Username:password on proxy-servers with basic authentication"));
printf (" %s\n", _("Username:password on proxy-servers with basic authentication"));
printf (" %s\n", "-A, --useragent=STRING");
printf (" %s\n", _("String to be sent in http header as \"User Agent\""));
printf (" %s\n", "-k, --header=STRING");
printf (" %s\n", _(" Any other tags to be sent in http header. Use multiple times for additional headers"));
printf (" %s\n", _("Any other tags to be sent in http header. Use multiple times for additional headers"));
printf (" %s\n", "-L, --link");
printf (" %s\n", _("Wrap output in HTML link (obsoleted by urlize)"));
printf (" %s\n", "-f, --onredirect=<ok|warning|critical|follow|sticky|stickyport>");
printf (" %s\n", _("How to handle redirected pages. sticky is like follow but stick to the"));
printf (" %s\n", _("specified IP address. stickyport also ensure post stays the same."));
printf (" %s\n", _("specified IP address. stickyport also ensures port stays the same."));
printf (" %s\n", "-m, --pagesize=INTEGER<:INTEGER>");
printf (" %s\n", _("Minimum page size required (bytes) : Maximum page size required (bytes)"));
@ -1412,6 +1411,10 @@ print_help (void)
printf (" %s\n", _("serve content (optionally within a specified time) or whether the X509 "));
printf (" %s\n", _("certificate is still valid for the specified number of days."));
printf ("\n");
printf (" %s\n", _("Please note that this plugin does not check if the presented server"));
printf (" %s\n", _("certificate matches the hostname of the server, or if the certificate"));
printf (" %s\n", _("has a valid chain of trust to one of the locally installed CAs."));
printf ("\n");
printf ("%s\n", _("Examples:"));
printf (" %s\n\n", "CHECK CONTENT: check_http -w 5 -c 10 --ssl -H www.verisign.com");
printf (" %s\n", _("When the 'www.verisign.com' server returns its content within 5 seconds,"));
@ -1441,6 +1444,6 @@ print_usage (void)
printf (" [-b proxy_auth] [-f <ok|warning|critcal|follow|sticky|stickyport>]\n");
printf (" [-e <expect>] [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n");
printf (" [-P string] [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] [-M <age>]\n");
printf (" [-A string] [-k string] [-S] [--sni] [-C <age>] [-T <content-type>]\n");
printf (" [-A string] [-k string] [-S <version>] [--sni] [-C <age>] [-T <content-type>]\n");
printf (" [-j method]\n");
}

View file

@ -58,7 +58,7 @@ char *ld_host = NULL;
char *ld_base = NULL;
char *ld_passwd = NULL;
char *ld_binddn = NULL;
int ld_port = DEFAULT_PORT;
int ld_port = -1;
#ifdef HAVE_LDAP_SET_OPTION
int ld_protocol = DEFAULT_PROTOCOL;
#endif
@ -247,7 +247,7 @@ process_arguments (int argc, char **argv)
{"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'V'},
{"timeout", required_argument, 0, 't'},
{"host", required_argument, 0, 'H'},
{"hostname", required_argument, 0, 'H'},
{"base", required_argument, 0, 'b'},
{"attr", required_argument, 0, 'a'},
{"bind", required_argument, 0, 'D'},
@ -341,7 +341,8 @@ process_arguments (int argc, char **argv)
case 'S':
if (! starttls) {
ssl_on_connect = TRUE;
ld_port = LDAPS_PORT;
if (ld_port == -1)
ld_port = LDAPS_PORT;
} else
usage_va(_("%s cannot be combined with %s"), "-S/--ssl", "-T/--starttls");
break;
@ -364,6 +365,9 @@ process_arguments (int argc, char **argv)
if (ld_base == NULL && argv[c])
ld_base = strdup (argv[c++]);
if (ld_port == -1)
ld_port = DEFAULT_PORT;
return validate_arguments ();
}

View file

@ -203,7 +203,12 @@ int main(int argc, char **argv){
uphours = (uptime % 86400) / 3600;
upminutes = ((uptime % 86400) % 3600) / 60;
asprintf(&output_message,_("System Uptime - %u day(s) %u hour(s) %u minute(s)"),updays,uphours, upminutes);
return_code=STATE_OK;
if (check_critical_value==TRUE && uptime <= critical_value)
return_code=STATE_CRITICAL;
else if (check_warning_value==TRUE && uptime <= warning_value)
return_code=STATE_WARNING;
else
return_code=STATE_OK;
break;
case CHECK_USEDDISKSPACE:

View file

@ -432,6 +432,7 @@ run_ping (const char *cmd, const char *addr)
{
char buf[MAX_INPUT_BUFFER];
int result = STATE_UNKNOWN;
int match;
if ((child_process = spopen (cmd)) == NULL)
die (STATE_UNKNOWN, _("Could not open pipe: %s\n"), cmd);
@ -448,28 +449,29 @@ run_ping (const char *cmd, const char *addr)
result = max_state (result, error_scan (buf, addr));
/* get the percent loss statistics */
if(sscanf(buf,"%*d packets transmitted, %*d packets received, +%*d errors, %d%% packet loss",&pl)==1 ||
sscanf(buf,"%*d packets transmitted, %*d packets received, +%*d duplicates, %d%% packet loss", &pl) == 1 ||
sscanf(buf,"%*d packets transmitted, %*d received, +%*d duplicates, %d%% packet loss", &pl) == 1 ||
sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% packet loss",&pl)==1 ||
sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% loss, time",&pl)==1 ||
sscanf(buf,"%*d packets transmitted, %*d received, %d%% loss, time", &pl)==1 ||
sscanf(buf,"%*d packets transmitted, %*d received, %d%% packet loss, time", &pl)==1 ||
sscanf(buf,"%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss", &pl) == 1 ||
sscanf(buf,"%*d packets transmitted %*d received, +%*d errors, %d%% packet loss", &pl) == 1
match = 0;
if((sscanf(buf,"%*d packets transmitted, %*d packets received, +%*d errors, %d%% packet loss%n",&pl,&match) && match) ||
(sscanf(buf,"%*d packets transmitted, %*d packets received, +%*d duplicates, %d%% packet loss%n",&pl,&match) && match) ||
(sscanf(buf,"%*d packets transmitted, %*d received, +%*d duplicates, %d%% packet loss%n",&pl,&match) && match) ||
(sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% packet loss%n",&pl,&match) && match) ||
(sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% loss, time%n",&pl,&match) && match) ||
(sscanf(buf,"%*d packets transmitted, %*d received, %d%% loss, time%n",&pl,&match) && match) ||
(sscanf(buf,"%*d packets transmitted, %*d received, %d%% packet loss, time%n",&pl,&match) && match) ||
(sscanf(buf,"%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss%n",&pl,&match) && match) ||
(sscanf(buf,"%*d packets transmitted %*d received, +%*d errors, %d%% packet loss%n",&pl,&match) && match)
)
continue;
/* get the round trip average */
else
if(sscanf(buf,"round-trip min/avg/max = %*f/%f/%*f",&rta)==1 ||
sscanf(buf,"round-trip min/avg/max/mdev = %*f/%f/%*f/%*f",&rta)==1 ||
sscanf(buf,"round-trip min/avg/max/sdev = %*f/%f/%*f/%*f",&rta)==1 ||
sscanf(buf,"round-trip min/avg/max/stddev = %*f/%f/%*f/%*f",&rta)==1 ||
sscanf(buf,"round-trip min/avg/max/std-dev = %*f/%f/%*f/%*f",&rta)==1 ||
sscanf(buf,"round-trip (ms) min/avg/max = %*f/%f/%*f",&rta)==1 ||
sscanf(buf,"round-trip (ms) min/avg/max/stddev = %*f/%f/%*f/%*f",&rta)==1 ||
sscanf(buf,"rtt min/avg/max/mdev = %*f/%f/%*f/%*f ms",&rta)==1)
if((sscanf(buf,"round-trip min/avg/max = %*f/%f/%*f%n",&rta,&match) && match) ||
(sscanf(buf,"round-trip min/avg/max/mdev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
(sscanf(buf,"round-trip min/avg/max/sdev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
(sscanf(buf,"round-trip min/avg/max/stddev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
(sscanf(buf,"round-trip min/avg/max/std-dev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
(sscanf(buf,"round-trip (ms) min/avg/max = %*f/%f/%*f%n",&rta,&match) && match) ||
(sscanf(buf,"round-trip (ms) min/avg/max/stddev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
(sscanf(buf,"rtt min/avg/max/mdev = %*f/%f/%*f/%*f ms%n",&rta,&match) && match))
continue;
}

View file

@ -318,6 +318,8 @@ process_arguments (int argc, char **argv)
int err;
int cflags = REG_NOSUB | REG_EXTENDED;
char errbuf[MAX_INPUT_BUFFER];
char *temp_string;
int i=0;
static struct option longopts[] = {
{"warning", required_argument, 0, 'w'},
{"critical", required_argument, 0, 'c'},
@ -450,7 +452,14 @@ process_arguments (int argc, char **argv)
regerror (err, &re_args, errbuf, MAX_INPUT_BUFFER);
die (STATE_UNKNOWN, "PROCS %s: %s - %s\n", _("UNKNOWN"), _("Could not compile regular expression"), errbuf);
}
asprintf (&fmt, "%s%sregex args '%s'", (fmt ? fmt : ""), (options ? ", " : ""), optarg);
/* Strip off any | within the regex optarg */
temp_string = strdup(optarg);
while(temp_string[i]!='\0'){
if(temp_string[i]=='|')
temp_string[i]=',';
i++;
}
asprintf (&fmt, "%s%sregex args '%s'", (fmt ? fmt : ""), (options ? ", " : ""), temp_string);
options |= EREG_ARGS;
break;
case 'r': /* RSS */

View file

@ -211,7 +211,7 @@ main (int argc, char **argv)
if (result == OK_RC)
die (STATE_OK, _("Auth OK"));
(void)snprintf(msg, sizeof(msg), _("Unexpected result code %d"), result);
die (STATE_UNKNOWN, msg);
die (STATE_UNKNOWN, "%s", msg);
}

View file

@ -114,6 +114,7 @@ enum {
TCP_PROTOCOL = 1,
UDP_PROTOCOL = 2,
};
int ignore_send_quit_failure = FALSE;
int
@ -129,6 +130,9 @@ main (int argc, char **argv)
char *error_msg = "";
struct timeval tv;
/* Catch pipe errors in read/write - sometimes occurs when writing QUIT */
(void) signal (SIGPIPE, SIG_IGN);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
@ -183,7 +187,7 @@ main (int argc, char **argv)
/* return a WARNING status if we couldn't read any data */
if (recvlines(buffer, MAX_INPUT_BUFFER) <= 0) {
printf (_("recv() failed\n"));
result = STATE_WARNING;
return STATE_WARNING;
}
else {
if (verbose)
@ -197,7 +201,7 @@ main (int argc, char **argv)
else
printf (_("Invalid SMTP response received from host on port %d: %s\n"),
server_port, buffer);
result = STATE_WARNING;
return STATE_WARNING;
}
}
@ -272,9 +276,6 @@ main (int argc, char **argv)
# ifdef USE_OPENSSL
if ( check_cert ) {
result = np_net_ssl_check_cert(days_till_exp);
if(result != STATE_OK){
printf ("%s\n", _("CRITICAL - Cannot retrieve server certificate."));
}
my_close();
return result;
}
@ -476,6 +477,7 @@ process_arguments (int argc, char **argv)
{"help", no_argument, 0, 'h'},
{"starttls",no_argument,0,'S'},
{"certificate",required_argument,0,'D'},
{"ignore-quit-failure",no_argument,0,'q'},
{0, 0, 0, 0}
};
@ -492,7 +494,7 @@ process_arguments (int argc, char **argv)
}
while (1) {
c = getopt_long (argc, argv, "+hVv46t:p:f:e:c:w:H:C:R:SD:F:A:U:P:",
c = getopt_long (argc, argv, "+hVv46t:p:f:e:c:w:H:C:R:SD:F:A:U:P:q",
longopts, &option);
if (c == -1 || c == EOF)
@ -579,6 +581,9 @@ process_arguments (int argc, char **argv)
case 'v': /* verbose */
verbose++;
break;
case 'q':
ignore_send_quit_failure++; /* ignore problem sending QUIT */
break;
case 't': /* timeout */
if (is_intnonneg (optarg)) {
socket_timeout = atoi (optarg);
@ -662,8 +667,20 @@ void
smtp_quit(void)
{
int bytes;
int n;
n = my_send(SMTP_QUIT, strlen(SMTP_QUIT));
if(n < 0) {
if(ignore_send_quit_failure) {
if(verbose) {
printf(_("Connection closed by server before sending QUIT command\n"));
}
return;
}
die (STATE_UNKNOWN,
_("Connection closed by server before sending QUIT command\n"));
}
my_send(SMTP_QUIT, strlen(SMTP_QUIT));
if (verbose)
printf(_("sent %s\n"), "QUIT");
@ -797,7 +814,9 @@ print_help (void)
printf (" %s\n", _("SMTP AUTH username"));
printf (" %s\n", "-P, --authpass=STRING");
printf (" %s\n", _("SMTP AUTH password"));
printf (" %s\n", "-q, --ignore-quit-failure");
printf (" %s\n", _("Ignore failure when sending QUIT command to server"));
printf (UT_WARN_CRIT);
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
@ -821,6 +840,6 @@ print_usage (void)
printf ("%s\n", _("Usage:"));
printf ("%s -H host [-p port] [-e expect] [-C command] [-f from addr]", progname);
printf ("[-A authtype -U authuser -P authpass] [-w warn] [-c crit] [-t timeout]\n");
printf ("[-F fqdn] [-S] [-D days] [-v] [-4|-6]\n");
printf ("[-F fqdn] [-S] [-D days] [-v] [-4|-6] [-q]\n");
}

View file

@ -169,7 +169,6 @@ main (int argc, char **argv)
char *state_string=NULL;
size_t response_length, current_length, string_length;
char *temp_string=NULL;
int is_numeric=0;
time_t current_time;
double temp_double;
time_t duration;
@ -335,29 +334,24 @@ main (int argc, char **argv)
/* We strip out the datatype indicator for PHBs */
if (strstr (response, "Gauge: ")) {
show = strstr (response, "Gauge: ") + 7;
is_numeric++;
}
else if (strstr (response, "Gauge32: ")) {
show = strstr (response, "Gauge32: ") + 9;
is_numeric++;
}
else if (strstr (response, "Counter32: ")) {
show = strstr (response, "Counter32: ") + 11;
is_numeric++;
is_counter=1;
if(!calculate_rate)
strcpy(type, "c");
}
else if (strstr (response, "Counter64: ")) {
show = strstr (response, "Counter64: ") + 11;
is_numeric++;
is_counter=1;
if(!calculate_rate)
strcpy(type, "c");
}
else if (strstr (response, "INTEGER: ")) {
show = strstr (response, "INTEGER: ") + 9;
is_numeric++;
}
else if (strstr (response, "STRING: ")) {
show = strstr (response, "STRING: ") + 8;
@ -396,15 +390,17 @@ main (int argc, char **argv)
}
}
else if (strstr (response, "Timeticks: "))
else if (strstr (response, "Timeticks: ")) {
show = strstr (response, "Timeticks: ");
}
else
show = response;
iresult = STATE_DEPENDENT;
/* Process this block for numeric comparisons */
if (is_numeric) {
/* Make some special values,like Timeticks numeric only if a threshold is defined */
if (thlds[i]->warning || thlds[i]->critical || calculate_rate) {
ptr = strpbrk (show, "0123456789");
if (ptr == NULL)
die (STATE_UNKNOWN,_("No valid data returned"));
@ -744,7 +740,7 @@ process_arguments (int argc, char **argv)
labels[nlabels - 1] = optarg;
ptr = thisarg (optarg);
labels[nlabels - 1] = ptr;
if (strstr (ptr, "'") == ptr)
if (ptr[0] == '\'')
labels[nlabels - 1] = ptr + 1;
while (ptr && (ptr = nextarg (ptr))) {
if (nlabels >= labels_size) {
@ -753,9 +749,9 @@ process_arguments (int argc, char **argv)
if (labels == NULL)
die (STATE_UNKNOWN, _("Could not reallocate labels\n"));
}
labels++;
nlabels++;
ptr = thisarg (ptr);
if (strstr (ptr, "'") == ptr)
if (ptr[0] == '\'')
labels[nlabels - 1] = ptr + 1;
else
labels[nlabels - 1] = ptr;
@ -773,7 +769,7 @@ process_arguments (int argc, char **argv)
unitv[nunits - 1] = optarg;
ptr = thisarg (optarg);
unitv[nunits - 1] = ptr;
if (strstr (ptr, "'") == ptr)
if (ptr[0] == '\'')
unitv[nunits - 1] = ptr + 1;
while (ptr && (ptr = nextarg (ptr))) {
if (nunits >= unitv_size) {
@ -784,7 +780,7 @@ process_arguments (int argc, char **argv)
}
nunits++;
ptr = thisarg (ptr);
if (strstr (ptr, "'") == ptr)
if (ptr[0] == '\'')
unitv[nunits - 1] = ptr + 1;
else
unitv[nunits - 1] = ptr;
@ -939,7 +935,7 @@ char *
thisarg (char *str)
{
str += strspn (str, " \t\r\n"); /* trim any leading whitespace */
if (strstr (str, "'") == str) { /* handle SIMPLE quoted strings */
if (str[0] == '\'') { /* handle SIMPLE quoted strings */
if (strlen (str) == 1 || !strstr (str + 1, "'"))
die (STATE_UNKNOWN, _("Unbalanced quotes\n"));
}
@ -955,7 +951,7 @@ thisarg (char *str)
char *
nextarg (char *str)
{
if (strstr (str, "'") == str) {
if (str[0] == '\'') {
str[0] = 0;
if (strlen (str) > 1) {
str = strstr (str + 1, "'");
@ -965,7 +961,7 @@ nextarg (char *str)
return NULL;
}
}
if (strstr (str, ",") == str) {
if (str[0] == ',') {
str[0] = 0;
if (strlen (str) > 1) {
return (++str);
@ -1076,8 +1072,8 @@ print_help (void)
printf ("\n");
printf ("%s\n", _("Notes:"));
printf (" %s\n", _("- Multiple OIDs may be indicated by a comma or space-delimited list (lists with"));
printf (" %s %i %s\n", _("internal spaces must be quoted). Maximum:"), MAX_OIDS, _("OIDs."));
printf (" %s\n", _("- Multiple OIDs (and labels) may be indicated by a comma or space-delimited "));
printf (" %s %i %s\n", _("list (lists with internal spaces must be quoted). Maximum:"), MAX_OIDS, _("OIDs."));
printf(" -%s", UT_THRESHOLDS_NOTES);

View file

@ -215,6 +215,10 @@ ssh_connect (char *haddr, int hport, char *remote_version)
char *ssh_proto = NULL;
char *ssh_server = NULL;
static char *rev_no = VERSION;
struct timeval tv;
double elapsed_time;
gettimeofday(&tv, NULL);
result = my_tcp_connect (haddr, hport, &sd);
@ -250,9 +254,12 @@ ssh_connect (char *haddr, int hport, char *remote_version)
exit (STATE_WARNING);
}
elapsed_time = (double)deltime(tv) / 1.0e6;
printf
(_("SSH OK - %s (protocol %s)\n"),
ssh_server, ssh_proto);
(_("SSH OK - %s (protocol %s) | %s\n"),
ssh_server, ssh_proto, fperfdata("time", elapsed_time, "s",
FALSE, 0, FALSE, 0, TRUE, 0, TRUE, (int)socket_timeout));
close(sd);
exit (STATE_OK);
}

View file

@ -236,12 +236,9 @@ main (int argc, char **argv)
result = np_net_ssl_init(sd);
if (result == STATE_OK && check_cert == TRUE) {
result = np_net_ssl_check_cert(days_till_exp);
if(result != STATE_OK) {
printf(_("CRITICAL - Cannot retrieve server certificate.\n"));
}
}
}
if(result != STATE_OK){
if(result != STATE_OK || check_cert == TRUE){
np_net_ssl_cleanup();
if(sd) close(sd);
return result;

View file

@ -3,7 +3,7 @@
* Nagios check_users plugin
*
* License: GPL
* Copyright (c) 2000-2007 Nagios Plugins Development Team
* Copyright (c) 2000-2012 Nagios Plugins Development Team
*
* Description:
*
@ -35,8 +35,8 @@ const char *copyright = "2000-2007";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
#include "common.h"
#include "popen.h"
#include "utils.h"
#include <utmpx.h>
#define possibly_set(a,b) ((a) == 0 ? (b) : 0)
@ -52,58 +52,33 @@ main (int argc, char **argv)
{
int users = -1;
int result = STATE_UNKNOWN;
char input_buffer[MAX_INPUT_BUFFER];
char *perf;
struct utmpx *putmpx;
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
perf = strdup("");
perf = strdup ("");
/* Parse extra opts if any */
argv=np_extra_opts (&argc, argv, progname);
argv = np_extra_opts (&argc, argv, progname);
if (process_arguments (argc, argv) == ERROR)
usage4 (_("Could not parse arguments"));
/* run the command */
child_process = spopen (WHO_COMMAND);
if (child_process == NULL) {
printf (_("Could not open pipe: %s\n"), WHO_COMMAND);
return STATE_UNKNOWN;
}
child_stderr = fdopen (child_stderr_array[fileno (child_process)], "r");
if (child_stderr == NULL)
printf (_("Could not open stderr for %s\n"), WHO_COMMAND);
users = 0;
while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process)) {
/* get currently logged users from utmpx */
setutxent ();
/* increment 'users' on all lines except total user count */
if (input_buffer[0] != '#') {
while ((putmpx = getutxent ()) != NULL)
if (putmpx->ut_type == USER_PROCESS)
users++;
continue;
}
/* get total logged in users */
if (sscanf (input_buffer, _("# users=%d"), &users) == 1)
break;
endutxent ();
}
/* check STDERR */
if (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_stderr))
result = possibly_set (result, STATE_UNKNOWN);
(void) fclose (child_stderr);
/* close the pipe */
if (spclose (child_process))
result = possibly_set (result, STATE_UNKNOWN);
/* else check the user count against warning and critical thresholds */
/* check the user count against warning and critical thresholds */
if (users > cusers)
result = STATE_CRITICAL;
else if (users > wusers)
@ -114,7 +89,7 @@ main (int argc, char **argv)
if (result == STATE_UNKNOWN)
printf ("%s\n", _("Unable to read output"));
else {
asprintf(&perf, "%s", perfdata ("users", users, "",
asprintf (&perf, "%s", perfdata ("users", users, "",
TRUE, wusers,
TRUE, cusers,
TRUE, 0,
@ -126,14 +101,11 @@ main (int argc, char **argv)
return result;
}
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
{
int c;
int option = 0;
static struct option longopts[] = {
{"critical", required_argument, 0, 'c'},
@ -183,7 +155,6 @@ process_arguments (int argc, char **argv)
else
wusers = atoi (argv[c++]);
}
if (cusers == -1 && argc > c) {
if (is_intnonneg (argv[c]) == FALSE)
usage4 (_("Warning threshold must be a positive integer"));
@ -194,8 +165,6 @@ process_arguments (int argc, char **argv)
return OK;
}
void
print_help (void)
{
@ -205,9 +174,9 @@ print_help (void)
printf (COPYRIGHT, copyright, email);
printf ("%s\n", _("This plugin checks the number of users currently logged in on the local"));
printf ("%s\n", _("system and generates an error if the number exceeds the thresholds specified."));
printf ("%s\n", _("system and generates an error if the number exceeds the thresholds specified."));
printf ("\n\n");
printf ("\n\n");
print_usage ();
@ -215,17 +184,16 @@ print_help (void)
printf (UT_EXTRA_OPTS);
printf (" %s\n", "-w, --warning=INTEGER");
printf (" %s\n", _("Set WARNING status if more than INTEGER users are logged in"));
printf (" %s\n", "-c, --critical=INTEGER");
printf (" %s\n", _("Set CRITICAL status if more than INTEGER users are logged in"));
printf (" %s\n", _("Set WARNING status if more than INTEGER users are logged in"));
printf (" %s\n", "-c, --critical=INTEGER");
printf (" %s\n", _("Set CRITICAL status if more than INTEGER users are logged in"));
printf (UT_SUPPORT);
}
void
print_usage (void)
{
printf ("%s\n", _("Usage:"));
printf ("%s\n", _("Usage:"));
printf ("%s -w <users> -c <users>\n", progname);
}

View file

@ -59,6 +59,12 @@
#include <math.h>
#endif
#ifdef _AIX
#ifdef HAVE_MP_H
#include <mp.h>
#endif
#endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif

View file

@ -3,7 +3,7 @@
* Nagios plugins SSL utilities
*
* License: GPL
* Copyright (c) 2005-2007 Nagios Plugins Development Team
* Copyright (c) 2005-2010 Nagios Plugins Development Team
*
* Description:
*
@ -26,6 +26,7 @@
*
*****************************************************************************/
#define MAX_CN_LENGTH 256
#define LOCAL_TIMEOUT_ALARM_HANDLER
#include "common.h"
#include "netutils.h"
@ -35,68 +36,104 @@ static SSL_CTX *c=NULL;
static SSL *s=NULL;
static int initialized=0;
int np_net_ssl_init (int sd) {
return np_net_ssl_init_with_hostname(sd, NULL);
int np_net_ssl_init(int sd) {
return np_net_ssl_init_with_hostname(sd, NULL);
}
int np_net_ssl_init_with_hostname (int sd, char *host_name) {
if (!initialized) {
/* Initialize SSL context */
SSLeay_add_ssl_algorithms ();
SSL_load_error_strings ();
OpenSSL_add_all_algorithms ();
initialized = 1;
}
if ((c = SSL_CTX_new (SSLv23_client_method ())) == NULL) {
printf ("%s\n", _("CRITICAL - Cannot create SSL context."));
return STATE_CRITICAL;
}
if ((s = SSL_new (c)) != NULL){
#ifdef SSL_set_tlsext_host_name
if (host_name != NULL)
SSL_set_tlsext_host_name(s, host_name);
#endif
SSL_set_fd (s, sd);
if (SSL_connect(s) == 1){
return OK;
} else {
printf ("%s\n", _("CRITICAL - Cannot make SSL connection "));
# ifdef USE_OPENSSL /* XXX look into ERR_error_string */
ERR_print_errors_fp (stdout);
# endif /* USE_OPENSSL */
}
} else {
printf ("%s\n", _("CRITICAL - Cannot initiate SSL handshake."));
}
int np_net_ssl_init_with_hostname(int sd, char *host_name) {
return np_net_ssl_init_with_hostname_and_version(sd, host_name, 0);
}
int np_net_ssl_init_with_hostname_and_version(int sd, char *host_name, int version) {
const SSL_METHOD *method = NULL;
switch (version) {
case 0: /* Deafult to auto negotiation */
method = SSLv23_client_method();
break;
case 1: /* TLSv1 protocol */
method = TLSv1_client_method();
break;
case 2: /* SSLv2 protocol */
#if defined(USE_GNUTLS) || defined(OPENSSL_NO_SSL2)
printf(("%s\n", _("CRITICAL - SSL protocol version 2 is not supported by your SSL library.")));
return STATE_CRITICAL;
}
void np_net_ssl_cleanup (){
if(s){
#ifdef SSL_set_tlsext_host_name
SSL_set_tlsext_host_name(s, NULL);
#else
method = SSLv2_client_method();
#endif
SSL_shutdown (s);
SSL_free (s);
if(c) {
SSL_CTX_free (c);
c=NULL;
}
s=NULL;
break;
case 3: /* SSLv3 protocol */
method = SSLv3_client_method();
break;
default: /* Unsupported */
printf("%s\n", _("CRITICAL - Unsupported SSL protocol version."));
return STATE_CRITICAL;
}
if (!initialized) {
/* Initialize SSL context */
SSLeay_add_ssl_algorithms();
SSL_load_error_strings();
OpenSSL_add_all_algorithms();
initialized = 1;
}
if ((c = SSL_CTX_new(method)) == NULL) {
printf("%s\n", _("CRITICAL - Cannot create SSL context."));
return STATE_CRITICAL;
}
#ifdef SSL_OP_NO_TICKET
SSL_CTX_set_options(c, SSL_OP_NO_TICKET);
#endif
if ((s = SSL_new(c)) != NULL) {
#ifdef SSL_set_tlsext_host_name
if (host_name != NULL)
SSL_set_tlsext_host_name(s, host_name);
#endif
SSL_set_fd(s, sd);
if (SSL_connect(s) == 1) {
return OK;
} else {
printf("%s\n", _("CRITICAL - Cannot make SSL connection."));
# ifdef USE_OPENSSL /* XXX look into ERR_error_string */
ERR_print_errors_fp(stdout);
# endif /* USE_OPENSSL */
}
} else {
printf("%s\n", _("CRITICAL - Cannot initiate SSL handshake."));
}
return STATE_CRITICAL;
}
int np_net_ssl_write(const void *buf, int num){
void np_net_ssl_cleanup() {
if (s) {
#ifdef SSL_set_tlsext_host_name
SSL_set_tlsext_host_name(s, NULL);
#endif
SSL_shutdown(s);
SSL_free(s);
if (c) {
SSL_CTX_free(c);
c=NULL;
}
s=NULL;
}
}
int np_net_ssl_write(const void *buf, int num) {
return SSL_write(s, buf, num);
}
int np_net_ssl_read(void *buf, int num){
int np_net_ssl_read(void *buf, int num) {
return SSL_read(s, buf, num);
}
int np_net_ssl_check_cert(int days_till_exp){
int np_net_ssl_check_cert(int days_till_exp) {
# ifdef USE_OPENSSL
X509 *certificate=NULL;
X509_NAME *subj=NULL;
char cn[MAX_CN_LENGTH]= "";
int cnlen =-1;
int status=STATE_UNKNOWN;
ASN1_STRING *tm;
int offset;
struct tm stamp;
@ -105,18 +142,29 @@ int np_net_ssl_check_cert(int days_till_exp){
char timestamp[17] = "";
certificate=SSL_get_peer_certificate(s);
if(! certificate){
printf ("%s\n",_("CRITICAL - Cannot retrieve server certificate."));
if (!certificate) {
printf("%s\n",_("CRITICAL - Cannot retrieve server certificate."));
return STATE_CRITICAL;
}
/* Extract CN from certificate subject */
subj=X509_get_subject_name(certificate);
if (!subj) {
printf("%s\n",_("CRITICAL - Cannot retrieve certificate subject."));
return STATE_CRITICAL;
}
cnlen = X509_NAME_get_text_by_NID(subj, NID_commonName, cn, sizeof(cn));
if (cnlen == -1)
strcpy(cn, _("Unknown CN"));
/* Retrieve timestamp of certificate */
tm = X509_get_notAfter (certificate);
tm = X509_get_notAfter(certificate);
/* Generate tm structure to process timestamp */
if (tm->type == V_ASN1_UTCTIME) {
if (tm->length < 10) {
printf ("%s\n", _("CRITICAL - Wrong time format in certificate."));
printf("%s\n", _("CRITICAL - Wrong time format in certificate."));
return STATE_CRITICAL;
} else {
stamp.tm_year = (tm->data[0] - '0') * 10 + (tm->data[1] - '0');
@ -126,7 +174,7 @@ int np_net_ssl_check_cert(int days_till_exp){
}
} else {
if (tm->length < 12) {
printf ("%s\n", _("CRITICAL - Wrong time format in certificate."));
printf("%s\n", _("CRITICAL - Wrong time format in certificate."));
return STATE_CRITICAL;
} else {
stamp.tm_year =
@ -155,21 +203,22 @@ int np_net_ssl_check_cert(int days_till_exp){
stamp.tm_mday, stamp.tm_year + 1900, stamp.tm_hour, stamp.tm_min);
if (days_left > 0 && days_left <= days_till_exp) {
printf (_("WARNING - Certificate expires in %d day(s) (%s).\n"), days_left, timestamp);
return STATE_WARNING;
printf(_("WARNING - Certificate '%s' expires in %d day(s) (%s).\n"), cn, days_left, timestamp);
status=STATE_WARNING;
} else if (time_left < 0) {
printf (_("CRITICAL - Certificate expired on %s.\n"), timestamp);
return STATE_CRITICAL;
printf(_("CRITICAL - Certificate '%s' expired on %s.\n"), cn, timestamp);
status=STATE_CRITICAL;
} else if (days_left == 0) {
printf (_("WARNING - Certificate expires today (%s).\n"), timestamp);
return STATE_WARNING;
printf(_("WARNING - Certificate '%s' expires today (%s).\n"), cn, timestamp);
status=STATE_WARNING;
} else {
printf(_("OK - Certificate '%s' will expire on %s.\n"), cn, timestamp);
status=STATE_OK;
}
printf (_("OK - Certificate will expire on %s.\n"), timestamp);
X509_free (certificate);
return STATE_OK;
X509_free(certificate);
return status;
# else /* ifndef USE_OPENSSL */
printf ("%s\n", _("WARNING - Plugin does not support checking certificates."));
printf("%s\n", _("WARNING - Plugin does not support checking certificates."));
return STATE_WARNING;
# endif /* USE_OPENSSL */
}

View file

@ -17,9 +17,14 @@ my $ssh_key = getTestParameter( "NP_SSH_IDENTITY",
"A key allowing access to NP_SSH_HOST",
"~/.ssh/id_dsa");
my $ssh_conf = getTestParameter( "NP_SSH_CONFIGFILE",
"A config file with ssh settings",
"~/.ssh/config");
plan skip_all => "SSH_HOST and SSH_IDENTITY must be defined" unless ($ssh_service && $ssh_key);
plan tests => 40;
plan tests => 42;
# Some random check strings/response
my @responce = ('OK: Everything is fine!',
@ -85,6 +90,12 @@ $result = NPTest->testCmd(
cmp_ok($result->return_code, '==', 8, "Exit with return code 8 (out of bounds)");
is($result->output, $responce[4], "Return proper status text even with unknown status codes");
$result = NPTest->testCmd(
"./check_by_ssh -i $ssh_key -H $ssh_service -F $ssh_conf -C 'exit 0'"
);
cmp_ok($result->return_code, '==', 0, "Exit with return code 0 (OK)");
is($result->output, 'OK - check_by_ssh: Remote command \'exit 0\' returned status 0', "Status text if command returned none (OK)");
# Multiple active checks
$result = NPTest->testCmd(
"./check_by_ssh -i $ssh_key -H $ssh_service -C '$check[1]; sh -c exit\\ 1' -C '$check[0]; sh -c exit\\ 0' -C '$check[3]; sh -c exit\\ 3' -C '$check[2]; sh -c exit\\ 2'"

View file

@ -102,7 +102,7 @@ SKIP: {
$res = NPTest->testCmd( "./check_http -C 1 --ssl www.verisign.com" );
cmp_ok( $res->return_code, '==', 0, "Checking certificate for www.verisign.com");
like ( $res->output, '/Certificate will expire on/', "Output OK" );
like ( $res->output, "/Certificate 'www.verisign.com' will expire on/", "Output OK" );
my $saved_cert_output = $res->output;
$res = NPTest->testCmd( "./check_http www.verisign.com -C 1" );

View file

@ -8,7 +8,7 @@ use strict;
use Test::More;
use NPTest;
my $tests = 8+38+2+2;
my $tests = 8+42+2+2;
plan tests => $tests;
my $res;
@ -124,6 +124,13 @@ SKIP: {
cmp_ok( $res->return_code, '==', 0, "Skipping all thresholds");
like($res->output, '/^SNMP OK - \d+ \w+ \d+\s.*$/', "Skipping all thresholds, result printed rather than parsed");
$res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o system.sysUpTime.0 -c 1000000000000: -u '1/100 sec'");
cmp_ok( $res->return_code, '==', 2, "Timetick used as a threshold");
like($res->output, '/^SNMP CRITICAL - \*\d+\* 1\/100 sec.*$/', "Timetick used as a threshold, parsed as numeric");
$res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o system.sysUpTime.0");
cmp_ok( $res->return_code, '==', 0, "Timetick used as a string");
like($res->output, '/^SNMP OK - Timeticks:\s\(\d+\)\s+(?:\d+ days?,\s+)?\d+:\d+:\d+\.\d+\s.*$/', "Timetick used as a string, result printed rather than parsed");
}
# These checks need a complete command line. An invalid community is used so

View file

@ -18,9 +18,24 @@ use Test::More;
use NPTest;
use FindBin qw($Bin);
use HTTP::Daemon;
use HTTP::Status;
use HTTP::Response;
my $common_tests = 66;
my $ssl_only_tests = 6;
# Check that all dependent modules are available
eval {
require HTTP::Daemon;
require HTTP::Status;
require HTTP::Response;
};
if ($@) {
plan skip_all => "Missing required module for test: $@";
} else {
if (-x "./check_http") {
plan tests => $common_tests * 2 + $ssl_only_tests;
} else {
plan skip_all => "No check_http compiled";
}
}
my $servers = { http => 0 }; # HTTP::Daemon should always be available
eval { require HTTP::Daemon::SSL };
@ -112,9 +127,9 @@ sub run_server {
$c->send_response("slow");
} elsif ($r->url->path eq "/method") {
if ($r->method eq "DELETE") {
$c->send_error(RC_METHOD_NOT_ALLOWED);
$c->send_error(HTTP::Status->RC_METHOD_NOT_ALLOWED);
} elsif ($r->method eq "foo") {
$c->send_error(RC_NOT_IMPLEMENTED);
$c->send_error(HTTP::Status->RC_NOT_IMPLEMENTED);
} else {
$c->send_status_line(200, $r->method);
}
@ -138,7 +153,7 @@ sub run_server {
delete($persist[1000]);
next MAINLOOP;
} else {
$c->send_error(RC_FORBIDDEN);
$c->send_error(HTTP::Status->RC_FORBIDDEN);
}
$c->close;
}
@ -157,14 +172,6 @@ if ($ARGV[0] && $ARGV[0] eq "-d") {
}
}
my $common_tests = 66;
my $ssl_only_tests = 6;
if (-x "./check_http") {
plan tests => $common_tests * 2 + $ssl_only_tests;
} else {
plan skip_all => "No check_http compiled";
}
my $result;
my $command = "./check_http -H 127.0.0.1";
@ -175,17 +182,17 @@ SKIP: {
$result = NPTest->testCmd( "$command -p $port_https -S -C 14" );
is( $result->return_code, 0, "$command -p $port_https -S -C 14" );
is( $result->output, 'OK - Certificate will expire on 03/03/2019 21:41.', "output ok" );
is( $result->output, 'OK - Certificate \'Ton Voon\' will expire on 03/03/2019 21:41.', "output ok" );
$result = NPTest->testCmd( "$command -p $port_https -S -C 14000" );
is( $result->return_code, 1, "$command -p $port_https -S -C 14000" );
like( $result->output, '/WARNING - Certificate expires in \d+ day\(s\) \(03/03/2019 21:41\)./', "output ok" );
like( $result->output, '/WARNING - Certificate \'Ton Voon\' expires in \d+ day\(s\) \(03/03/2019 21:41\)./', "output ok" );
# Expired cert tests
$result = NPTest->testCmd( "$command -p $port_https_expired -S -C 7" );
is( $result->return_code, 2, "$command -p $port_https_expired -S -C 7" );
is( $result->output,
'CRITICAL - Certificate expired on 03/05/2009 00:13.',
'CRITICAL - Certificate \'Ton Voon\' expired on 03/05/2009 00:13.',
"output ok" );
}

View file

@ -8,7 +8,7 @@ use Test::More;
use NPTest;
if (-x "./check_procs") {
plan tests => 48;
plan tests => 50;
} else {
plan skip_all => "No check_procs compiled";
}
@ -113,3 +113,7 @@ $result = NPTest->testCmd( "$command --metric=RSS -c 70000 -v" );
is( $result->return_code, 2, "Checking against RSS > 70MB" );
is( $result->output, 'RSS CRITICAL: 5 crit, 0 warn out of 95 processes [WindowServer, SystemUIServer, Safari, Mail, Safari]', "Output correct" );
$result = NPTest->testCmd( "$command --ereg-argument-array='(nosuchname|nosuch2name)'" );
is( $result->return_code, 0, "Checking no pipe symbol in output" );
is( $result->output, "PROCS OK: 0 processes with regex args '(nosuchname,nosuch2name)'", "Output correct" );

View file

@ -8,6 +8,7 @@ use Test::More;
use NPTest;
use FindBin qw($Bin);
my $tests = 41;
# Check that all dependent modules are available
eval {
require NetSNMP::OID;
@ -17,6 +18,12 @@ eval {
if ($@) {
plan skip_all => "Missing required module for test: $@";
} else {
if (-x "./check_snmp") {
plan tests => $tests;
} else {
plan skip_all => "No check_snmp compiled";
}
}
my $port_snmp = 16100 + int(rand(100));
@ -51,12 +58,8 @@ if ($ARGV[0] && $ARGV[0] eq "-d") {
}
}
my $tests = 33;
if (-x "./check_snmp") {
plan tests => $tests;
} else {
plan skip_all => "No check_snmp compiled";
}
# We should merge that with $ENV{'NPTEST_CACHE'}, use one dir for all test data
$ENV{'NAGIOS_PLUGIN_STATE_DIRECTORY'} ||= "/var/tmp";
my $res;
@ -106,7 +109,7 @@ like($res->output, '/'.quotemeta('SNMP OK - And now have fun with with this: \"C
"And now have fun with with this: \"C:\\\\\"
because we\'re not done yet!"').'/m', "Attempt to confuse parser No.3");
system("rm /usr/local/nagios/var/check_snmp/*");
system("rm -f ".$ENV{'NAGIOS_PLUGIN_STATE_DIRECTORY'}."/check_snmp/*");
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -w 600" );
is($res->return_code, 0, "Returns OK");
is($res->output, "No previous data to calculate rate - assume okay");
@ -170,5 +173,19 @@ $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1
is($res->return_code, 0, "OK as string doesn't match but inverted" );
is($res->output, 'SNMP OK - "stringtests" | ', "OK as inverted string no match" );
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.12 -w 4:5" );
is($res->return_code, 1, "Numeric in string test" );
is($res->output, 'SNMP WARNING - *3.5* | iso.3.6.1.4.1.8072.3.2.67.12=3.5 ', "WARNING threshold checks for string masquerading as number" );
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.13" );
is($res->return_code, 0, "Not really numeric test" );
is($res->output, 'SNMP OK - "87.4startswithnumberbutshouldbestring" | ', "Check string with numeric start is still string" );
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.14" );
is($res->return_code, 0, "Not really numeric test (trying best to fool it)" );
is($res->output, 'SNMP OK - "555\"I said\"" | ', "Check string with a double quote following is still a string (looks like the perl routine will always escape though)" );
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.15 -r 'CUSTOM CHECK OK'" );
is($res->return_code, 0, "String check should check whole string, not a parsed number" );
is($res->output, 'SNMP OK - "CUSTOM CHECK OK: foo is 12345" | ', "String check witn numbers returns whole string");

View file

@ -33,9 +33,10 @@ ends with with this: C:\\';
my $multilin5 = 'And now have fun with with this: "C:\\"
because we\'re not done yet!';
my @fields = (ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_UNSIGNED, ASN_UNSIGNED, ASN_COUNTER, ASN_COUNTER64, ASN_UNSIGNED, ASN_COUNTER, ASN_OCTET_STR);
my @values = ($multiline, $multilin2, $multilin3, $multilin4, $multilin5, 4294965296, 1000, 4294965296, uint64("18446744073709351616"), int(rand(2**32)), 64000, "stringtests");
my @incrts = (undef, undef, undef, undef, undef, 1000, -500, 1000, 100000, undef, 666, undef);
# 0..15 <---- please update comment when adding/removing fields
my @fields = (ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_UNSIGNED, ASN_UNSIGNED, ASN_COUNTER, ASN_COUNTER64, ASN_UNSIGNED, ASN_COUNTER, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR );
my @values = ($multiline, $multilin2, $multilin3, $multilin4, $multilin5, 4294965296, 1000, 4294965296, uint64("18446744073709351616"), int(rand(2**32)), 64000, "stringtests", "3.5", "87.4startswithnumberbutshouldbestring", '555"I said"', 'CUSTOM CHECK OK: foo is 12345' );
my @incrts = (undef, undef, undef, undef, undef, 1000, -500, 1000, 100000, undef, 666, undef, undef, undef, undef, undef );
# Number of elements in our OID
my $oidelts;

BIN
po/de.gmo

Binary file not shown.

1166
po/de.po

File diff suppressed because it is too large Load diff

BIN
po/fr.gmo

Binary file not shown.

1140
po/fr.po

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1 +1 @@
1.4.15
1.4.15-59-ga80e

View file

@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -141,7 +141,7 @@ am__libtap_la_SOURCES_DIST = tap.c tap.h
@USE_LIBTAP_LOCAL_TRUE@am_libtap_la_OBJECTS = tap.lo
libtap_la_OBJECTS = $(am_libtap_la_OBJECTS)
@USE_LIBTAP_LOCAL_TRUE@am_libtap_la_rpath =
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@ -1097,8 +1097,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@ -1110,8 +1110,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@ -1121,13 +1121,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique