mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
Merge branch 'master' into issue92
This commit is contained in:
commit
1730917cf6
201
centreon-plugins/LICENSE.txt
Normal file
201
centreon-plugins/LICENSE.txt
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
You can monitor many systems:
|
You can monitor many systems:
|
||||||
* application: Apache, Asterisk, Elasticsearch, Github, Jenkins, Nginx, Pfsense, Tomcat, Varnish,...
|
* application: Apache, Asterisk, Elasticsearch, Github, Jenkins, Nginx, Pfsense, Tomcat, Varnish,...
|
||||||
* database: Informix, MySQL, Postgres, Oracle, MS SQL
|
* database: Firebird, Informix, MySQL, Postgres, Oracle, MS SQL
|
||||||
* hardware: printers (rfc3805), UPS (Powerware, Mge, Standard), Sun Hardware, Cisco UCS, SensorIP, HP Proliant, HP Bladechassis, Dell Openmanage, Dell CMC,
|
* hardware: printers (rfc3805), UPS (Powerware, Mge, Standard), Sun Hardware, Cisco UCS, SensorIP, HP Proliant, HP Bladechassis, Dell Openmanage, Dell CMC,
|
||||||
* network: Aruba, Brocade, Bluecoat, Brocade, Checkpoint, Cisco AP/IronPort/ASA/Standard, Extreme, Fortigate, H3C, Hirschmann, HP Procurve, F5 BIG-IP, Juniper, PaloAlto, Redback, Riverbed, Ruggedcom, Stonesoft,...
|
* network: Aruba, Brocade, Bluecoat, Brocade, Checkpoint, Cisco AP/IronPort/ASA/Standard, Extreme, Fortigate, H3C, Hirschmann, HP Procurve, F5 BIG-IP, Juniper, PaloAlto, Redback, Riverbed, Ruggedcom, Stonesoft,...
|
||||||
* os: Linux (SNMP, NRPE), Freebsd (SNMP), AIX (SNMP), Solaris (SNMP)...
|
* os: Linux (SNMP, NRPE), Freebsd (SNMP), AIX (SNMP), Solaris (SNMP)...
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::activedirectory::local::mode::dcdiag;
|
package apps::activedirectory::local::mode::dcdiag;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::activedirectory::local::mode::netdom;
|
package apps::activedirectory::local::mode::netdom;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::activedirectory::local::plugin;
|
package apps::activedirectory::local::plugin;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::activedirectory::wsman::mode::dcdiag;
|
package apps::activedirectory::wsman::mode::dcdiag;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::activedirectory::wsman::plugin;
|
package apps::activedirectory::wsman::plugin;
|
||||||
|
|
||||||
|
@ -1,38 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Author : Simon BOMM <sbomm@merethis.com>
|
|
||||||
#
|
#
|
||||||
# Based on De Bodt Lieven plugin
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
####################################################################################
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::apache::serverstatus::mode::cpuload;
|
package apps::apache::serverstatus::mode::cpuload;
|
||||||
|
|
||||||
@ -40,7 +24,7 @@ use base qw(centreon::plugins::mode);
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::http;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
@ -52,7 +36,7 @@ sub new {
|
|||||||
{
|
{
|
||||||
"hostname:s" => { name => 'hostname' },
|
"hostname:s" => { name => 'hostname' },
|
||||||
"port:s" => { name => 'port', },
|
"port:s" => { name => 'port', },
|
||||||
"proto:s" => { name => 'proto', default => "http" },
|
"proto:s" => { name => 'proto' },
|
||||||
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
||||||
"credentials" => { name => 'credentials' },
|
"credentials" => { name => 'credentials' },
|
||||||
"username:s" => { name => 'username' },
|
"username:s" => { name => 'username' },
|
||||||
@ -60,8 +44,9 @@ sub new {
|
|||||||
"proxyurl:s" => { name => 'proxyurl' },
|
"proxyurl:s" => { name => 'proxyurl' },
|
||||||
"warning:s" => { name => 'warning' },
|
"warning:s" => { name => 'warning' },
|
||||||
"critical:s" => { name => 'critical' },
|
"critical:s" => { name => 'critical' },
|
||||||
"timeout:s" => { name => 'timeout', default => '3' },
|
"timeout:s" => { name => 'timeout' },
|
||||||
});
|
});
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,20 +62,13 @@ sub check_options {
|
|||||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
if (!defined($self->{option_results}->{hostname})) {
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the hostname option");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if ((defined($self->{option_results}->{credentials})) && (!defined($self->{option_results}->{username}) || !defined($self->{option_results}->{password}))) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "You need to set --username= and --password= options when --credentials is used");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $webcontent = centreon::plugins::httplib::connect($self);
|
my $webcontent = $self->{http}->request();
|
||||||
# If not present: cpuload is 0
|
# If not present: cpuload is 0
|
||||||
my ($cpuload) = 0;
|
my ($cpuload) = 0;
|
||||||
|
|
||||||
|
@ -1,38 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Author : Simon BOMM <sbomm@merethis.com>
|
|
||||||
#
|
#
|
||||||
# Based on De Bodt Lieven plugin
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
####################################################################################
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::apache::serverstatus::mode::requests;
|
package apps::apache::serverstatus::mode::requests;
|
||||||
|
|
||||||
@ -40,7 +24,7 @@ use base qw(centreon::plugins::mode);
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::http;
|
||||||
use centreon::plugins::statefile;
|
use centreon::plugins::statefile;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
@ -53,7 +37,7 @@ sub new {
|
|||||||
{
|
{
|
||||||
"hostname:s" => { name => 'hostname' },
|
"hostname:s" => { name => 'hostname' },
|
||||||
"port:s" => { name => 'port', },
|
"port:s" => { name => 'port', },
|
||||||
"proto:s" => { name => 'proto', default => "http" },
|
"proto:s" => { name => 'proto' },
|
||||||
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
||||||
"credentials" => { name => 'credentials' },
|
"credentials" => { name => 'credentials' },
|
||||||
"username:s" => { name => 'username' },
|
"username:s" => { name => 'username' },
|
||||||
@ -65,8 +49,9 @@ sub new {
|
|||||||
"critical-bytes:s" => { name => 'critical_bytes' },
|
"critical-bytes:s" => { name => 'critical_bytes' },
|
||||||
"warning-access:s" => { name => 'warning_access' },
|
"warning-access:s" => { name => 'warning_access' },
|
||||||
"critical-access:s" => { name => 'critical_access' },
|
"critical-access:s" => { name => 'critical_access' },
|
||||||
"timeout:s" => { name => 'timeout', default => '3' },
|
"timeout:s" => { name => 'timeout' },
|
||||||
});
|
});
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
$self->{statefile_value} = centreon::plugins::statefile->new(%options);
|
$self->{statefile_value} = centreon::plugins::statefile->new(%options);
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
@ -99,22 +84,15 @@ sub check_options {
|
|||||||
$self->{output}->add_option_msg(short_msg => "Wrong critical-access threshold '" . $self->{option_results}->{critical_access} . "'.");
|
$self->{output}->add_option_msg(short_msg => "Wrong critical-access threshold '" . $self->{option_results}->{critical_access} . "'.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
if (!defined($self->{option_results}->{hostname})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the hostname option");
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if ((defined($self->{option_results}->{credentials})) && (!defined($self->{option_results}->{username}) || !defined($self->{option_results}->{password}))) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "You need to set --username= and --password= options when --credentials is used");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$self->{statefile_value}->check_options(%options);
|
$self->{statefile_value}->check_options(%options);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $webcontent = centreon::plugins::httplib::connect($self);
|
my $webcontent = $self->{http}->request();
|
||||||
my ($rPerSec, $bPerReq, $total_access, $total_bytes, $avg_bPerSec);
|
my ($rPerSec, $bPerReq, $total_access, $total_bytes, $avg_bPerSec);
|
||||||
|
|
||||||
$total_access = $1 if ($webcontent =~ /^Total Accesses:\s+([^\s]+)/mi);
|
$total_access = $1 if ($webcontent =~ /^Total Accesses:\s+([^\s]+)/mi);
|
||||||
@ -137,7 +115,7 @@ sub run {
|
|||||||
$avg_bPerSec = '0' . $avg_bPerSec if ($avg_bPerSec =~ /^\./);
|
$avg_bPerSec = '0' . $avg_bPerSec if ($avg_bPerSec =~ /^\./);
|
||||||
$bPerReq = '0' . $bPerReq if ($bPerReq =~ /^\./);
|
$bPerReq = '0' . $bPerReq if ($bPerReq =~ /^\./);
|
||||||
|
|
||||||
$self->{statefile_value}->read(statefile => 'apache_' . $self->{option_results}->{hostname} . '_' . centreon::plugins::httplib::get_port($self) . '_' . $self->{mode});
|
$self->{statefile_value}->read(statefile => 'apache_' . $self->{option_results}->{hostname} . '_' . $self->{http}->get_port() . '_' . $self->{mode});
|
||||||
my $old_timestamp = $self->{statefile_value}->get(name => 'last_timestamp');
|
my $old_timestamp = $self->{statefile_value}->get(name => 'last_timestamp');
|
||||||
my $old_total_access = $self->{statefile_value}->get(name => 'total_access');
|
my $old_total_access = $self->{statefile_value}->get(name => 'total_access');
|
||||||
my $old_total_bytes = $self->{statefile_value}->get(name => 'total_bytes');
|
my $old_total_bytes = $self->{statefile_value}->get(name => 'total_bytes');
|
||||||
|
@ -1,38 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Author : Simon BOMM <sbomm@merethis.com>
|
|
||||||
#
|
#
|
||||||
# Based on De Bodt Lieven plugin
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
####################################################################################
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::apache::serverstatus::mode::responsetime;
|
package apps::apache::serverstatus::mode::responsetime;
|
||||||
|
|
||||||
@ -41,7 +25,7 @@ use base qw(centreon::plugins::mode);
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Time::HiRes qw(gettimeofday tv_interval);
|
use Time::HiRes qw(gettimeofday tv_interval);
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::http;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
@ -53,7 +37,7 @@ sub new {
|
|||||||
{
|
{
|
||||||
"hostname:s" => { name => 'hostname' },
|
"hostname:s" => { name => 'hostname' },
|
||||||
"port:s" => { name => 'port', },
|
"port:s" => { name => 'port', },
|
||||||
"proto:s" => { name => 'proto', default => "http" },
|
"proto:s" => { name => 'proto' },
|
||||||
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
||||||
"credentials" => { name => 'credentials' },
|
"credentials" => { name => 'credentials' },
|
||||||
"username:s" => { name => 'username' },
|
"username:s" => { name => 'username' },
|
||||||
@ -61,8 +45,12 @@ sub new {
|
|||||||
"proxyurl:s" => { name => 'proxyurl' },
|
"proxyurl:s" => { name => 'proxyurl' },
|
||||||
"warning:s" => { name => 'warning' },
|
"warning:s" => { name => 'warning' },
|
||||||
"critical:s" => { name => 'critical' },
|
"critical:s" => { name => 'critical' },
|
||||||
"timeout:s" => { name => 'timeout', default => '3' },
|
"timeout:s" => { name => 'timeout' },
|
||||||
|
"unknown-status:s" => { name => 'unknown_status', default => '' },
|
||||||
|
"warning-status:s" => { name => 'warning_status' },
|
||||||
|
"critical-status:s" => { name => 'critical_status', default => '%{http_code} < 200 or %{http_code} >= 300' },
|
||||||
});
|
});
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,19 +67,7 @@ sub check_options {
|
|||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($self->{option_results}->{proto} ne 'http') && ($self->{option_results}->{proto} ne 'https')) {
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
$self->{output}->add_option_msg(short_msg => "Unsupported protocol specified '" . $self->{option_results}->{proto} . "'.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!defined($self->{option_results}->{hostname})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the hostname option");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if ((defined($self->{option_results}->{credentials})) && (!defined($self->{option_results}->{username}) || !defined($self->{option_results}->{password}))) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "You need to set --username= and --password= options when --credentials is used");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
@ -99,18 +75,19 @@ sub run {
|
|||||||
|
|
||||||
my $timing0 = [gettimeofday];
|
my $timing0 = [gettimeofday];
|
||||||
|
|
||||||
my $webcontent = centreon::plugins::httplib::connect($self, connection_exit => 'critical');
|
my $webcontent = $self->{http}->request();
|
||||||
|
|
||||||
my $timeelapsed = tv_interval ($timing0, [gettimeofday]);
|
my $timeelapsed = tv_interval ($timing0, [gettimeofday]);
|
||||||
|
|
||||||
my $exit = $self->{perfdata}->threshold_check(value => $timeelapsed,
|
my $exit = $self->{perfdata}->threshold_check(value => $timeelapsed,
|
||||||
threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(severity => $exit,
|
||||||
short_msg => sprintf("Response time %fs ", $timeelapsed));
|
short_msg => sprintf("Response time %.3fs", $timeelapsed));
|
||||||
$self->{output}->perfdata_add(label => "time",
|
$self->{output}->perfdata_add(label => "time", unit => 's',
|
||||||
value => $timeelapsed,
|
value => sprintf('%.3f', $timeelapsed),
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'));
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
|
||||||
|
min => 0);
|
||||||
|
|
||||||
$self->{output}->display();
|
$self->{output}->display();
|
||||||
$self->{output}->exit();
|
$self->{output}->exit();
|
||||||
@ -162,6 +139,18 @@ Proxy URL if any
|
|||||||
|
|
||||||
Threshold for HTTP timeout
|
Threshold for HTTP timeout
|
||||||
|
|
||||||
|
=item B<--unknown-status>
|
||||||
|
|
||||||
|
Threshold warning for http response code
|
||||||
|
|
||||||
|
=item B<--warning-status>
|
||||||
|
|
||||||
|
Threshold warning for http response code
|
||||||
|
|
||||||
|
=item B<--critical-status>
|
||||||
|
|
||||||
|
Threshold critical for http response code (Default: '%{http_code} < 200 or %{http_code} >= 300')
|
||||||
|
|
||||||
=item B<--warning>
|
=item B<--warning>
|
||||||
|
|
||||||
Threshold warning in seconds (server-status page response time)
|
Threshold warning in seconds (server-status page response time)
|
||||||
|
@ -1,38 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Author : Simon BOMM <sbomm@merethis.com>
|
|
||||||
#
|
#
|
||||||
# Based on De Bodt Lieven plugin
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
####################################################################################
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::apache::serverstatus::mode::slotstates;
|
package apps::apache::serverstatus::mode::slotstates;
|
||||||
|
|
||||||
@ -40,28 +24,208 @@ use base qw(centreon::plugins::mode);
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::http;
|
||||||
|
use centreon::plugins::values;
|
||||||
|
|
||||||
|
my $instance_mode;
|
||||||
|
|
||||||
|
my $maps_counters = {
|
||||||
|
global => {
|
||||||
|
'000_busy' => { set => {
|
||||||
|
key_values => [ { name => 'busy' }, { name => 'total' } ],
|
||||||
|
closure_custom_calc => \&custom_value_calc, closure_custom_calc_extra_options => { label_ref => 'busy' },
|
||||||
|
closure_custom_output => \&custom_value_output,
|
||||||
|
closure_custom_threshold_check => \&custom_value_threshold,
|
||||||
|
closure_custom_perfdata => \&custom_value_perfdata,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'001_free' => { set => {
|
||||||
|
key_values => [ { name => 'free' }, { name => 'total' } ],
|
||||||
|
closure_custom_calc => \&custom_value_calc, closure_custom_calc_extra_options => { label_ref => 'free' },
|
||||||
|
closure_custom_output => \&custom_value_output,
|
||||||
|
closure_custom_threshold_check => \&custom_value_threshold,
|
||||||
|
closure_custom_perfdata => \&custom_value_perfdata,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'002_waiting' => { set => {
|
||||||
|
key_values => [ { name => 'waiting' }, { name => 'total' } ],
|
||||||
|
closure_custom_calc => \&custom_value_calc, closure_custom_calc_extra_options => { label_ref => 'waiting' },
|
||||||
|
closure_custom_output => \&custom_value_output,
|
||||||
|
closure_custom_threshold_check => \&custom_value_threshold,
|
||||||
|
closure_custom_perfdata => \&custom_value_perfdata,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'003_starting' => { set => {
|
||||||
|
key_values => [ { name => 'starting' }, { name => 'total' } ],
|
||||||
|
closure_custom_calc => \&custom_value_calc, closure_custom_calc_extra_options => { label_ref => 'starting' },
|
||||||
|
closure_custom_output => \&custom_value_output,
|
||||||
|
closure_custom_threshold_check => \&custom_value_threshold,
|
||||||
|
closure_custom_perfdata => \&custom_value_perfdata,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'004_reading' => { set => {
|
||||||
|
key_values => [ { name => 'reading' }, { name => 'total' } ],
|
||||||
|
closure_custom_calc => \&custom_value_calc, closure_custom_calc_extra_options => { label_ref => 'reading' },
|
||||||
|
closure_custom_output => \&custom_value_output,
|
||||||
|
closure_custom_threshold_check => \&custom_value_threshold,
|
||||||
|
closure_custom_perfdata => \&custom_value_perfdata,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'005_sending' => { set => {
|
||||||
|
key_values => [ { name => 'sending' }, { name => 'total' } ],
|
||||||
|
closure_custom_calc => \&custom_value_calc, closure_custom_calc_extra_options => { label_ref => 'sending' },
|
||||||
|
closure_custom_output => \&custom_value_output,
|
||||||
|
closure_custom_threshold_check => \&custom_value_threshold,
|
||||||
|
closure_custom_perfdata => \&custom_value_perfdata,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'006_keepalive' => { set => {
|
||||||
|
key_values => [ { name => 'keepalive' }, { name => 'total' } ],
|
||||||
|
closure_custom_calc => \&custom_value_calc, closure_custom_calc_extra_options => { label_ref => 'keepalive' },
|
||||||
|
closure_custom_output => \&custom_value_output,
|
||||||
|
closure_custom_threshold_check => \&custom_value_threshold,
|
||||||
|
closure_custom_perfdata => \&custom_value_perfdata,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'007_dns-lookup' => { set => {
|
||||||
|
key_values => [ { name => 'dns_lookup' }, { name => 'total' } ],
|
||||||
|
closure_custom_calc => \&custom_value_calc, closure_custom_calc_extra_options => { label_ref => 'dns_lookup' },
|
||||||
|
closure_custom_output => \&custom_value_output,
|
||||||
|
closure_custom_threshold_check => \&custom_value_threshold,
|
||||||
|
closure_custom_perfdata => \&custom_value_perfdata,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'008_closing' => { set => {
|
||||||
|
key_values => [ { name => 'closing' }, { name => 'total' } ],
|
||||||
|
closure_custom_calc => \&custom_value_calc, closure_custom_calc_extra_options => { label_ref => 'closing' },
|
||||||
|
closure_custom_output => \&custom_value_output,
|
||||||
|
closure_custom_threshold_check => \&custom_value_threshold,
|
||||||
|
closure_custom_perfdata => \&custom_value_perfdata,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'009_logging' => { set => {
|
||||||
|
key_values => [ { name => 'logging' }, { name => 'total' } ],
|
||||||
|
closure_custom_calc => \&custom_value_calc, closure_custom_calc_extra_options => { label_ref => 'logging' },
|
||||||
|
closure_custom_output => \&custom_value_output,
|
||||||
|
closure_custom_threshold_check => \&custom_value_threshold,
|
||||||
|
closure_custom_perfdata => \&custom_value_perfdata,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'007_gracefuly-finished' => { set => {
|
||||||
|
key_values => [ { name => 'gracefuly_finished' }, { name => 'total' } ],
|
||||||
|
closure_custom_calc => \&custom_value_calc, closure_custom_calc_extra_options => { label_ref => 'gracefuly_finished' },
|
||||||
|
closure_custom_output => \&custom_value_output,
|
||||||
|
closure_custom_threshold_check => \&custom_value_threshold,
|
||||||
|
closure_custom_perfdata => \&custom_value_perfdata,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'007_idle-cleanup-worker' => { set => {
|
||||||
|
key_values => [ { name => 'idle_cleanup_worker' }, { name => 'total' } ],
|
||||||
|
closure_custom_calc => \&custom_value_calc, closure_custom_calc_extra_options => { label_ref => 'idle_cleanup_worker' },
|
||||||
|
closure_custom_output => \&custom_value_output,
|
||||||
|
closure_custom_threshold_check => \&custom_value_threshold,
|
||||||
|
closure_custom_perfdata => \&custom_value_perfdata,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
sub custom_value_threshold {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
my $exit = 'ok';
|
||||||
|
if ($instance_mode->{option_results}->{units} eq '%') {
|
||||||
|
$exit = $self->{perfdata}->threshold_check(value => $self->{result_values}->{prct}, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-' . $self->{label}, exit_litteral => 'warning' } ]);
|
||||||
|
} else {
|
||||||
|
$exit = $self->{perfdata}->threshold_check(value => $self->{result_values}->{used}, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-' . $self->{label}, exit_litteral => 'warning' } ]);
|
||||||
|
}
|
||||||
|
return $exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub custom_value_perfdata {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
my ($warning, $critical);
|
||||||
|
if ($instance_mode->{option_results}->{units} eq '%') {
|
||||||
|
$warning = $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, total => $self->{result_values}->{total}, cast_int => 1);
|
||||||
|
$critical = $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, total => $self->{result_values}->{total}, cast_int => 1);
|
||||||
|
} else {
|
||||||
|
$warning = $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label});
|
||||||
|
$critical = $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label});
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{output}->perfdata_add(label => $self->{result_values}->{label},
|
||||||
|
value => $self->{result_values}->{used},
|
||||||
|
warning => $warning,
|
||||||
|
critical => $critical,
|
||||||
|
min => 0, max => $self->{result_values}->{total});
|
||||||
|
}
|
||||||
|
|
||||||
|
sub custom_value_output {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
my $label = $self->{result_values}->{label};
|
||||||
|
$label =~ s/_/ /g;
|
||||||
|
$label =~ s/(\w+)/\u$1/g;
|
||||||
|
my $msg = sprintf("%s : %s (%.2f %%)",
|
||||||
|
ucfirst($label),
|
||||||
|
$self->{result_values}->{used}, $self->{result_values}->{prct});
|
||||||
|
return $msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub custom_value_calc {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
$self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'};
|
||||||
|
if ($self->{result_values}->{total} == 0) {
|
||||||
|
$self->{error_msg} = "skipped";
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
$self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_' . $options{extra_options}->{label_ref}};
|
||||||
|
$self->{result_values}->{prct} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total};
|
||||||
|
$self->{result_values}->{label} = $options{extra_options}->{label_ref};
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments =>
|
||||||
{
|
{
|
||||||
"hostname:s" => { name => 'hostname' },
|
"hostname:s" => { name => 'hostname' },
|
||||||
"port:s" => { name => 'port', },
|
"port:s" => { name => 'port', },
|
||||||
"proto:s" => { name => 'proto', default => "http" },
|
"proto:s" => { name => 'proto' },
|
||||||
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
||||||
"credentials" => { name => 'credentials' },
|
"credentials" => { name => 'credentials' },
|
||||||
"username:s" => { name => 'username' },
|
"username:s" => { name => 'username' },
|
||||||
"password:s" => { name => 'password' },
|
"password:s" => { name => 'password' },
|
||||||
"proxyurl:s" => { name => 'proxyurl' },
|
"proxyurl:s" => { name => 'proxyurl' },
|
||||||
"warning:s" => { name => 'warning' },
|
"timeout:s" => { name => 'timeout' },
|
||||||
"critical:s" => { name => 'critical' },
|
"units:s" => { name => 'units', default => '%' },
|
||||||
"timeout:s" => { name => 'timeout', default => '3' },
|
});
|
||||||
});
|
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
|
|
||||||
|
foreach my $key (('global')) {
|
||||||
|
foreach (keys %{$maps_counters->{$key}}) {
|
||||||
|
my ($id, $name) = split /_/;
|
||||||
|
if (!defined($maps_counters->{$key}->{$_}->{threshold}) || $maps_counters->{$key}->{$_}->{threshold} != 0) {
|
||||||
|
$options{options}->add_options(arguments => {
|
||||||
|
'warning-' . $name . ':s' => { name => 'warning-' . $name },
|
||||||
|
'critical-' . $name . ':s' => { name => 'critical-' . $name },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$maps_counters->{$key}->{$_}->{obj} = centreon::plugins::values->new(output => $self->{output},
|
||||||
|
perfdata => $self->{perfdata},
|
||||||
|
label => $name);
|
||||||
|
$maps_counters->{$key}->{$_}->{obj}->set(%{$maps_counters->{$key}->{$_}->{set}});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,76 +233,81 @@ sub check_options {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
foreach my $key (('global')) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
foreach (keys %{$maps_counters->{$key}}) {
|
||||||
$self->{output}->option_exit();
|
$maps_counters->{$key}->{$_}->{obj}->init(option_results => $self->{option_results});
|
||||||
}
|
}
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($self->{option_results}->{proto} ne 'http') && ($self->{option_results}->{proto} ne 'https')) {
|
$instance_mode = $self;
|
||||||
$self->{output}->add_option_msg(short_msg => "Unsupported protocol specified '" . $self->{option_results}->{proto} . "'.");
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (!defined($self->{option_results}->{hostname})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the hostname option");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if ((defined($self->{option_results}->{credentials})) && (!defined($self->{option_results}->{username}) || !defined($self->{option_results}->{password}))) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "You need to set --username= and --password= options when --credentials is used");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
$self->manage_selection();
|
||||||
|
|
||||||
my $webcontent = centreon::plugins::httplib::connect($self);
|
my ($short_msg, $short_msg_append, $long_msg, $long_msg_append) = ('', '', '', '');
|
||||||
|
my @exits;
|
||||||
|
|
||||||
|
foreach (sort keys %{$maps_counters->{global}}) {
|
||||||
|
my $obj = $maps_counters->{global}->{$_}->{obj};
|
||||||
|
|
||||||
|
$obj->set(instance => 'global');
|
||||||
|
|
||||||
|
my ($value_check) = $obj->execute(values => $self->{global});
|
||||||
|
|
||||||
|
if ($value_check != 0) {
|
||||||
|
$long_msg .= $long_msg_append . $obj->output_error();
|
||||||
|
$long_msg_append = ', ';
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
my $exit2 = $obj->threshold_check();
|
||||||
|
push @exits, $exit2;
|
||||||
|
|
||||||
|
my $output = $obj->output();
|
||||||
|
$long_msg .= $long_msg_append . $output;
|
||||||
|
$long_msg_append = ', ';
|
||||||
|
|
||||||
|
if (!$self->{output}->is_status(litteral => 1, value => $exit2, compare => 'ok')) {
|
||||||
|
$short_msg .= $short_msg_append . $output;
|
||||||
|
$short_msg_append = ', ';
|
||||||
|
}
|
||||||
|
|
||||||
|
$obj->perfdata();
|
||||||
|
}
|
||||||
|
|
||||||
|
my $exit = $self->{output}->get_most_critical(status => [ @exits ]);
|
||||||
|
if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) {
|
||||||
|
$self->{output}->output_add(severity => $exit,
|
||||||
|
short_msg => "Slots $short_msg"
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$self->{output}->output_add(short_msg => "Slots $long_msg");
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{output}->display();
|
||||||
|
$self->{output}->exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
sub manage_selection {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
my $webcontent = $self->{http}->request();
|
||||||
my $ScoreBoard = "";
|
my $ScoreBoard = "";
|
||||||
if ($webcontent =~ /^Scoreboard:\s+([^\s]+)/mi) {
|
if ($webcontent =~ /^Scoreboard:\s+([^\s]+)/mi) {
|
||||||
$ScoreBoard = $1;
|
$ScoreBoard = $1;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $srvLimit = length($ScoreBoard);
|
$self->{global} = { total => length($ScoreBoard),
|
||||||
my $CountOpenSlots = ($ScoreBoard =~ tr/\.//);
|
free => ($ScoreBoard =~ tr/\.//),
|
||||||
|
busy => length($ScoreBoard) - ($ScoreBoard =~ tr/\.//),
|
||||||
my $exit = $self->{perfdata}->threshold_check(value => $CountOpenSlots,
|
waiting => ($ScoreBoard =~ tr/\_//), starting => ($ScoreBoard =~ tr/S//),
|
||||||
threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
reading => ($ScoreBoard =~ tr/R//), sending => ($ScoreBoard =~ tr/W//),
|
||||||
|
keepalive => ($ScoreBoard =~ tr/K//), dns_lookup => ($ScoreBoard =~ tr/D//),
|
||||||
$self->{output}->output_add(severity => $exit,
|
closing => ($ScoreBoard =~ tr/C//), logging => ($ScoreBoard =~ tr/L//),
|
||||||
short_msg => sprintf("Free slots: %d", $CountOpenSlots));
|
gracefuly_finished => ($ScoreBoard =~ tr/G//), idle_cleanup_worker => ($ScoreBoard =~ tr/I//)};
|
||||||
$self->{output}->perfdata_add(label => "freeSlots",
|
|
||||||
value => $CountOpenSlots,
|
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
|
|
||||||
min => 0,
|
|
||||||
max => $srvLimit);
|
|
||||||
$self->{output}->perfdata_add(label => "waiting",
|
|
||||||
value => ($ScoreBoard =~ tr/\_//));
|
|
||||||
$self->{output}->perfdata_add(label => "starting",
|
|
||||||
value => ($ScoreBoard =~ tr/S//));
|
|
||||||
$self->{output}->perfdata_add(label => "reading",
|
|
||||||
value => ($ScoreBoard =~ tr/R//));
|
|
||||||
$self->{output}->perfdata_add(label => "sending",
|
|
||||||
value => ($ScoreBoard =~ tr/W//));
|
|
||||||
$self->{output}->perfdata_add(label => "keepalive",
|
|
||||||
value => ($ScoreBoard =~ tr/K//));
|
|
||||||
$self->{output}->perfdata_add(label => "dns_lookup",
|
|
||||||
value => ($ScoreBoard =~ tr/D//));
|
|
||||||
$self->{output}->perfdata_add(label => "closing",
|
|
||||||
value => ($ScoreBoard =~ tr/C//));
|
|
||||||
$self->{output}->perfdata_add(label => "logging",
|
|
||||||
value => ($ScoreBoard =~ tr/L//));
|
|
||||||
$self->{output}->perfdata_add(label => "gracefuly_finished",
|
|
||||||
value => ($ScoreBoard =~ tr/G//));
|
|
||||||
$self->{output}->perfdata_add(label => "idle_cleanup_worker",
|
|
||||||
value => ($ScoreBoard =~ tr/I//));
|
|
||||||
|
|
||||||
$self->{output}->display();
|
|
||||||
$self->{output}->exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
@ -187,13 +356,25 @@ Specify password for basic authentification (Mandatory if --credentials is speci
|
|||||||
|
|
||||||
Threshold for HTTP timeout
|
Threshold for HTTP timeout
|
||||||
|
|
||||||
|
=item B<--units>
|
||||||
|
|
||||||
|
Threshold unit (Default: '%'. Can be: '%' or 'absolute')
|
||||||
|
|
||||||
=item B<--warning>
|
=item B<--warning>
|
||||||
|
|
||||||
Warning Threshold on remaining free slot
|
Warning threshold.
|
||||||
|
Can be: 'busy', 'free', 'waiting', 'starting', 'reading',
|
||||||
|
'sending', 'keepalive', 'dns-lookup', 'closing',
|
||||||
|
'logging', 'gracefuly-finished', 'idle-cleanup-worker'.
|
||||||
|
|
||||||
=item B<--critical>
|
=item B<--critical>
|
||||||
|
|
||||||
Critical Threshold on remaining free slot
|
Critical threshold.
|
||||||
|
Can be: 'busy', 'free', 'waiting', 'starting', 'reading',
|
||||||
|
'sending', 'keepalive', 'dns-lookup', 'closing',
|
||||||
|
'logging', 'gracefuly-finished', 'idle-cleanup-worker'.
|
||||||
|
|
||||||
|
=over 8)
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
|
@ -1,38 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Author : Simon BOMM <sbomm@merethis.com>
|
|
||||||
#
|
#
|
||||||
# Based on De Bodt Lieven plugin
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
####################################################################################
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::apache::serverstatus::mode::workers;
|
package apps::apache::serverstatus::mode::workers;
|
||||||
|
|
||||||
@ -40,7 +24,7 @@ use base qw(centreon::plugins::mode);
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::http;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
@ -52,7 +36,7 @@ sub new {
|
|||||||
{
|
{
|
||||||
"hostname:s" => { name => 'hostname' },
|
"hostname:s" => { name => 'hostname' },
|
||||||
"port:s" => { name => 'port', },
|
"port:s" => { name => 'port', },
|
||||||
"proto:s" => { name => 'proto', default => "http" },
|
"proto:s" => { name => 'proto' },
|
||||||
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
||||||
"credentials" => { name => 'credentials' },
|
"credentials" => { name => 'credentials' },
|
||||||
"username:s" => { name => 'username' },
|
"username:s" => { name => 'username' },
|
||||||
@ -60,8 +44,9 @@ sub new {
|
|||||||
"proxyurl:s" => { name => 'proxyurl' },
|
"proxyurl:s" => { name => 'proxyurl' },
|
||||||
"warning:s" => { name => 'warning' },
|
"warning:s" => { name => 'warning' },
|
||||||
"critical:s" => { name => 'critical' },
|
"critical:s" => { name => 'critical' },
|
||||||
"timeout:s" => { name => 'timeout', default => '3' },
|
"timeout:s" => { name => 'timeout' },
|
||||||
});
|
});
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,25 +62,13 @@ sub check_options {
|
|||||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
if (($self->{option_results}->{proto} ne 'http') && ($self->{option_results}->{proto} ne 'https')) {
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
$self->{output}->add_option_msg(short_msg => "Unsupported protocol specified '" . $self->{option_results}->{proto} . "'.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (!defined($self->{option_results}->{hostname})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the hostname option");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if ((defined($self->{option_results}->{credentials})) && (!defined($self->{option_results}->{username}) || !defined($self->{option_results}->{password}))) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "You need to set --username= and --password= options when --credentials is used");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $webcontent = centreon::plugins::httplib::connect($self);
|
my $webcontent = $self->{http}->request();
|
||||||
my ($BusyWorkers, $IdleWorkers, $ScoreBoard);
|
my ($BusyWorkers, $IdleWorkers, $ScoreBoard);
|
||||||
if ($webcontent =~ /^BusyWorkers:\s+([^\s]+)/mi) {
|
if ($webcontent =~ /^BusyWorkers:\s+([^\s]+)/mi) {
|
||||||
$BusyWorkers = $1;
|
$BusyWorkers = $1;
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::apache::serverstatus::plugin;
|
package apps::apache::serverstatus::plugin;
|
||||||
|
|
||||||
|
@ -1,65 +0,0 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Author : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::apc::web::plugin;
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use base qw(centreon::plugins::script_simple);
|
|
||||||
|
|
||||||
sub new {
|
|
||||||
my ($class, %options) = @_;
|
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
|
||||||
bless $self, $class;
|
|
||||||
# $options->{options} = options object
|
|
||||||
|
|
||||||
$self->{version} = '0.1';
|
|
||||||
%{$self->{modes}} = (
|
|
||||||
'file-cache' => 'apps::apc::web::mode::filecache',
|
|
||||||
'memory' => 'apps::apc::web::mode::memory',
|
|
||||||
);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
|
||||||
|
|
||||||
__END__
|
|
||||||
|
|
||||||
=head1 PLUGIN DESCRIPTION
|
|
||||||
|
|
||||||
Check apc php module through the webpage
|
|
||||||
|
|
||||||
=cut
|
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::apcupsd::local::mode::batterycharge;
|
package apps::apcupsd::local::mode::batterycharge;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::apcupsd::local::mode::batteryvoltage;
|
package apps::apcupsd::local::mode::batteryvoltage;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::apcupsd::local::mode::libgetdata;
|
package apps::apcupsd::local::mode::libgetdata;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::apcupsd::local::mode::linefrequency;
|
package apps::apcupsd::local::mode::linefrequency;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::apcupsd::local::mode::linevoltage;
|
package apps::apcupsd::local::mode::linevoltage;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::apcupsd::local::mode::loadpercentage;
|
package apps::apcupsd::local::mode::loadpercentage;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::apcupsd::local::mode::outputvoltage;
|
package apps::apcupsd::local::mode::outputvoltage;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::apcupsd::local::mode::temperature;
|
package apps::apcupsd::local::mode::temperature;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::apcupsd::local::mode::timeleft;
|
package apps::apcupsd::local::mode::timeleft;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
# see http://manned.org/apcaccess
|
# see http://manned.org/apcaccess
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2014 CENTREON
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
|
||||||
# Foundation ; either version 2 of the License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# service performance.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
#
|
||||||
# As a special exception, the copyright holders of this program give CENTREON
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# distribute the resulting timeelapsedutable under terms of CENTREON choice, provided that
|
# See the License for the specific language governing permissions and
|
||||||
# CENTREON also meet, for each linked independent module, the terms and conditions
|
# limitations under the License.
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
#
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Author : Mathieu Cinquin <mcinquin@centreon.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::bluemind::mode::incoming;
|
package apps::bluemind::mode::incoming;
|
||||||
|
|
||||||
@ -39,7 +24,7 @@ use base qw(centreon::plugins::mode);
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::http;
|
||||||
use centreon::plugins::statefile;
|
use centreon::plugins::statefile;
|
||||||
use JSON;
|
use JSON;
|
||||||
|
|
||||||
@ -53,18 +38,18 @@ sub new {
|
|||||||
{
|
{
|
||||||
"hostname:s" => { name => 'hostname' },
|
"hostname:s" => { name => 'hostname' },
|
||||||
"port:s" => { name => 'port', default => '8086'},
|
"port:s" => { name => 'port', default => '8086'},
|
||||||
"proto:s" => { name => 'proto', default => 'http' },
|
"proto:s" => { name => 'proto' },
|
||||||
"urlpath:s" => { name => 'url_path', default => "/db" },
|
"urlpath:s" => { name => 'url_path', default => "/db" },
|
||||||
"database:s" => { name => 'database' },
|
"database:s" => { name => 'database' },
|
||||||
"username:s" => { name => 'username' },
|
"username:s" => { name => 'username' },
|
||||||
"password:s" => { name => 'password' },
|
"password:s" => { name => 'password' },
|
||||||
"warning:s" => { name => 'warning' },
|
"warning:s" => { name => 'warning' },
|
||||||
"critical:s" => { name => 'critical' },
|
"critical:s" => { name => 'critical' },
|
||||||
"timeout:s" => { name => 'timeout', default => '3' },
|
"timeout:s" => { name => 'timeout' },
|
||||||
});
|
});
|
||||||
|
|
||||||
$self->{statefile_value} = centreon::plugins::statefile->new(%options);
|
$self->{statefile_value} = centreon::plugins::statefile->new(%options);
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,10 +65,6 @@ sub check_options {
|
|||||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
if (!defined($self->{option_results}->{hostname})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the hostname option");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (!defined($self->{option_results}->{database})) {
|
if (!defined($self->{option_results}->{database})) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the database option");
|
$self->{output}->add_option_msg(short_msg => "Please set the database option");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
@ -92,14 +73,20 @@ sub check_options {
|
|||||||
$self->{output}->add_option_msg(short_msg => "You need to set --username= and --password= option");
|
$self->{output}->add_option_msg(short_msg => "You need to set --username= and --password= option");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $query = 'select sum("success") as "success_sum", sum("failure") as "failure_sum" from lmtpd.deliveries where time > '.$old_timestamp.'s and time < now()';
|
||||||
|
$self->{option_results}->{url_path} = $self->{option_results}->{url_path}."/".$self->{option_results}->{database}."/series";
|
||||||
|
$self->{option_results}->{get_param} = [];
|
||||||
|
push @{$self->{option_results}->{get_param}}, "q=" . $query, "p=" . $self->{option_results}->{password}, "u=" . $self->{option_results}->{username};
|
||||||
|
|
||||||
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
$self->{statefile_value}->check_options(%options);
|
$self->{statefile_value}->check_options(%options);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{statefile_value}->read(statefile => 'bluemind_' . $self->{option_results}->{hostname} . '_' . centreon::plugins::httplib::get_port($self) . '_' . $self->{mode});
|
$self->{statefile_value}->read(statefile => 'bluemind_' . $self->{option_results}->{hostname} . '_' . $self->{http}->get_port() . '_' . $self->{mode});
|
||||||
my $old_timestamp = $self->{statefile_value}->get(name => 'last_timestamp');
|
my $old_timestamp = $self->{statefile_value}->get(name => 'last_timestamp');
|
||||||
|
|
||||||
my $new_datas = {};
|
my $new_datas = {};
|
||||||
@ -113,14 +100,9 @@ sub run {
|
|||||||
$self->{output}->exit();
|
$self->{output}->exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{option_results}->{url_path} = $self->{option_results}->{url_path}."/".$self->{option_results}->{database}."/series";
|
my $jsoncontent = $self->{http}->request();
|
||||||
$self->{option_results}->{query} = 'select sum("success") as "success_sum", sum("failure") as "failure_sum" from lmtpd.deliveries where time > '.$old_timestamp.'s and time < now()';
|
|
||||||
|
|
||||||
my $query_form_get = { q => $self->{option_results}->{query}, p => $self->{option_results}->{password}, u => $self->{option_results}->{username} };
|
|
||||||
my $jsoncontent = centreon::plugins::httplib::connect($self, query_form_get => $query_form_get);
|
|
||||||
|
|
||||||
my $json = JSON->new;
|
my $json = JSON->new;
|
||||||
|
|
||||||
my $webcontent;
|
my $webcontent;
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
|
||||||
# Foundation ; either version 2 of the License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# service performance.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
#
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# permission to link this program with independent modules to produce an executable,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
# See the License for the specific language governing permissions and
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
# limitations under the License.
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
#
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Mathieu Cinquin <mcinquin@merethis.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::bluemind::plugin;
|
package apps::bluemind::plugin;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::centreon::local::mode::metaservice;
|
package apps::centreon::local::mode::metaservice;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Simon BOMM <sbomm@centreon.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::centreon::local::mode::retentionbroker;
|
package apps::centreon::local::mode::retentionbroker;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::centreon::local::plugin;
|
package apps::centreon::local::plugin;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2015 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@centreon.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::centreon::mysql::mode::countnotifications;
|
package apps::centreon::mysql::mode::countnotifications;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2015 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@centreon.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::centreon::mysql::mode::countproblems;
|
package apps::centreon::mysql::mode::countproblems;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2015 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
|
||||||
# Foundation ; either version 2 of the License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# service performance.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
#
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# permission to link this program with independent modules to produce an executable,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
# See the License for the specific language governing permissions and
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
# limitations under the License.
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
#
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Simon Bomm <sbomm@merethis.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::centreon::mysql::mode::partitioning;
|
package apps::centreon::mysql::mode::partitioning;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Kevin Duret <kduret@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::centreon::mysql::mode::pollerdelay;
|
package apps::centreon::mysql::mode::pollerdelay;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2015 CENTREON
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
|
||||||
# Foundation ; either version 2 of the License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# service performance.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
#
|
||||||
# As a special exception, the copyright holders of this program give CENTREON
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# distribute the resulting timeelapsedutable under terms of CENTREON choice, provided that
|
# See the License for the specific language governing permissions and
|
||||||
# CENTREON also meet, for each linked independent module, the terms and conditions
|
# limitations under the License.
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
#
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Mathieu Cinquin <mcinquin@centreon.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::checkmyws::mode::status;
|
package apps::checkmyws::mode::status;
|
||||||
|
|
||||||
@ -39,7 +24,7 @@ use base qw(centreon::plugins::mode);
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::http;
|
||||||
use JSON;
|
use JSON;
|
||||||
|
|
||||||
my $thresholds = {
|
my $thresholds = {
|
||||||
@ -65,10 +50,11 @@ sub new {
|
|||||||
"urlpath:s" => { name => 'url_path', default => "/api/status" },
|
"urlpath:s" => { name => 'url_path', default => "/api/status" },
|
||||||
"proxyurl:s" => { name => 'proxyurl' },
|
"proxyurl:s" => { name => 'proxyurl' },
|
||||||
"uid:s" => { name => 'uid' },
|
"uid:s" => { name => 'uid' },
|
||||||
"timeout:s" => { name => 'timeout', default => '3' },
|
"timeout:s" => { name => 'timeout' },
|
||||||
"threshold-overload:s@" => { name => 'threshold_overload' },
|
"threshold-overload:s@" => { name => 'threshold_overload' },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,19 +89,19 @@ sub check_options {
|
|||||||
$self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section}));
|
$self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section}));
|
||||||
push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status};
|
push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$self->{option_results}->{url_path} = $self->{option_results}->{url_path}."/".$self->{option_results}->{uid};
|
||||||
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{option_results}->{url_path} = $self->{option_results}->{url_path}."/".$self->{option_results}->{uid};
|
my $jsoncontent = $self->{http}->request();
|
||||||
|
|
||||||
my $jsoncontent = centreon::plugins::httplib::connect($self);
|
|
||||||
|
|
||||||
my $json = JSON->new;
|
my $json = JSON->new;
|
||||||
|
|
||||||
my $webcontent;
|
my $webcontent;
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
$webcontent = $json->decode($jsoncontent);
|
$webcontent = $json->decode($jsoncontent);
|
||||||
};
|
};
|
||||||
@ -229,7 +215,7 @@ ID for checkmyws API
|
|||||||
|
|
||||||
=item B<--timeout>
|
=item B<--timeout>
|
||||||
|
|
||||||
Threshold for HTTP timeout (Default: '3')
|
Threshold for HTTP timeout (Default: 5)
|
||||||
|
|
||||||
=item B<--threshold-overload>
|
=item B<--threshold-overload>
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2015 CENTREON
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
|
||||||
# Foundation ; either version 2 of the License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# service performance.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
#
|
||||||
# As a special exception, the copyright holders of this program give CENTREON
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# permission to link this program with independent modules to produce an executable,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# distribute the resulting executable under terms of CENTREON choice, provided that
|
# See the License for the specific language governing permissions and
|
||||||
# CENTREON also meet, for each linked independent module, the terms and conditions
|
# limitations under the License.
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
#
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Mathieu Cinquin <mcinquin@centreon.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::checkmyws::plugin;
|
package apps::checkmyws::plugin;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::citrix::local::mode::folder;
|
package apps::citrix::local::mode::folder;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::citrix::local::mode::license;
|
package apps::citrix::local::mode::license;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::citrix::local::mode::session;
|
package apps::citrix::local::mode::session;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::citrix::local::mode::zone;
|
package apps::citrix::local::mode::zone;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::citrix::local::plugin;
|
package apps::citrix::local::plugin;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2015 CENTREON
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
|
||||||
# Foundation ; either version 2 of the License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# service performance.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
#
|
||||||
# As a special exception, the copyright holders of this program give CENTREON
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# distribute the resulting timeelapsedutable under terms of CENTREON choice, provided that
|
# See the License for the specific language governing permissions and
|
||||||
# CENTREON also meet, for each linked independent module, the terms and conditions
|
# limitations under the License.
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
#
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Mathieu Cinquin <mcinquin@centreon.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::elasticsearch::mode::cluster;
|
package apps::elasticsearch::mode::cluster;
|
||||||
|
|
||||||
@ -39,7 +24,7 @@ use base qw(centreon::plugins::mode);
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::http;
|
||||||
use JSON;
|
use JSON;
|
||||||
|
|
||||||
my $thresholds = {
|
my $thresholds = {
|
||||||
@ -60,15 +45,16 @@ sub new {
|
|||||||
{
|
{
|
||||||
"hostname:s" => { name => 'hostname' },
|
"hostname:s" => { name => 'hostname' },
|
||||||
"port:s" => { name => 'port', default => '9200'},
|
"port:s" => { name => 'port', default => '9200'},
|
||||||
"proto:s" => { name => 'proto', default => 'http' },
|
"proto:s" => { name => 'proto' },
|
||||||
"urlpath:s" => { name => 'url_path', default => '/' },
|
"urlpath:s" => { name => 'url_path' },
|
||||||
"credentials" => { name => 'credentials' },
|
"credentials" => { name => 'credentials' },
|
||||||
"username:s" => { name => 'username' },
|
"username:s" => { name => 'username' },
|
||||||
"password:s" => { name => 'password' },
|
"password:s" => { name => 'password' },
|
||||||
"timeout:s" => { name => 'timeout', default => '3' },
|
"timeout:s" => { name => 'timeout' },
|
||||||
"threshold-overload:s@" => { name => 'threshold_overload' },
|
"threshold-overload:s@" => { name => 'threshold_overload' },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,15 +62,6 @@ sub check_options {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
if (!defined($self->{option_results}->{hostname})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the hostname option");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if ((defined($self->{option_results}->{credentials})) && (!defined($self->{option_results}->{username}) || !defined($self->{option_results}->{password}))) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "You need to set --username= and --password= options when --credentials is used");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$self->{overload_th} = {};
|
$self->{overload_th} = {};
|
||||||
foreach my $val (@{$self->{option_results}->{threshold_overload}}) {
|
foreach my $val (@{$self->{option_results}->{threshold_overload}}) {
|
||||||
if ($val !~ /^(.*?),(.*?),(.*)$/) {
|
if ($val !~ /^(.*?),(.*?),(.*)$/) {
|
||||||
@ -99,6 +76,9 @@ sub check_options {
|
|||||||
$self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section}));
|
$self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section}));
|
||||||
push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status};
|
push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$self->{option_results}->{url_path} = $self->{option_results}->{url_path} . "_cluster/health/";
|
||||||
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
}
|
}
|
||||||
|
|
||||||
sub get_severity {
|
sub get_severity {
|
||||||
@ -126,9 +106,7 @@ sub get_severity {
|
|||||||
sub run {
|
sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{option_results}->{url_path} = $self->{option_results}->{url_path}."_cluster/health/";
|
my $jsoncontent = $self->{http}->request();
|
||||||
|
|
||||||
my $jsoncontent = centreon::plugins::httplib::connect($self, connection_exit => 'critical');
|
|
||||||
|
|
||||||
my $json = JSON->new;
|
my $json = JSON->new;
|
||||||
|
|
||||||
@ -214,7 +192,7 @@ Specify password for API authentification
|
|||||||
|
|
||||||
=item B<--timeout>
|
=item B<--timeout>
|
||||||
|
|
||||||
Threshold for HTTP timeout (Default: 3)
|
Threshold for HTTP timeout (Default: 5)
|
||||||
|
|
||||||
=item B<--threshold-overload>
|
=item B<--threshold-overload>
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2015 CENTREON
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
|
||||||
# Foundation ; either version 2 of the License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# service performance.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
#
|
||||||
# As a special exception, the copyright holders of this program give CENTREON
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# distribute the resulting timeelapsedutable under terms of CENTREON choice, provided that
|
# See the License for the specific language governing permissions and
|
||||||
# CENTREON also meet, for each linked independent module, the terms and conditions
|
# limitations under the License.
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
#
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Mathieu Cinquin <mcinquin@centreon.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::elasticsearch::mode::indices;
|
package apps::elasticsearch::mode::indices;
|
||||||
|
|
||||||
@ -39,7 +24,7 @@ use base qw(centreon::plugins::mode);
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::http;
|
||||||
use JSON;
|
use JSON;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
|
||||||
@ -62,20 +47,21 @@ sub new {
|
|||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.1';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments =>
|
||||||
{
|
{
|
||||||
"hostname:s" => { name => 'hostname' },
|
"hostname:s" => { name => 'hostname' },
|
||||||
"port:s" => { name => 'port', default => '9200'},
|
"port:s" => { name => 'port', default => '9200'},
|
||||||
"proto:s" => { name => 'proto', default => 'http' },
|
"proto:s" => { name => 'proto' },
|
||||||
"urlpath:s" => { name => 'url_path', default => '/' },
|
"urlpath:s" => { name => 'url_path' },
|
||||||
"credentials" => { name => 'credentials' },
|
"credentials" => { name => 'credentials' },
|
||||||
"username:s" => { name => 'username' },
|
"username:s" => { name => 'username' },
|
||||||
"password:s" => { name => 'password' },
|
"password:s" => { name => 'password' },
|
||||||
"timeout:s" => { name => 'timeout', default => '3' },
|
"timeout:s" => { name => 'timeout' },
|
||||||
"threshold-overload:s@" => { name => 'threshold_overload' },
|
"threshold-overload:s@" => { name => 'threshold_overload' },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,15 +69,6 @@ sub check_options {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
if (!defined($self->{option_results}->{hostname})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the hostname option");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if ((defined($self->{option_results}->{credentials})) && (!defined($self->{option_results}->{username}) || !defined($self->{option_results}->{password}))) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "You need to set --username= and --password= options when --credentials is used");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$self->{overload_th} = {};
|
$self->{overload_th} = {};
|
||||||
foreach my $val (@{$self->{option_results}->{threshold_overload}}) {
|
foreach my $val (@{$self->{option_results}->{threshold_overload}}) {
|
||||||
if ($val !~ /^(.*?),(.*?),(.*)$/) {
|
if ($val !~ /^(.*?),(.*?),(.*)$/) {
|
||||||
@ -107,6 +84,9 @@ sub check_options {
|
|||||||
push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status};
|
push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$self->{option_results}->{url_path} = $self->{option_results}->{url_path} . "_cluster/health";
|
||||||
|
$self->{option_results}->{get_param} = ['level=indices'];
|
||||||
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
}
|
}
|
||||||
|
|
||||||
sub get_severity {
|
sub get_severity {
|
||||||
@ -134,19 +114,14 @@ sub get_severity {
|
|||||||
sub run {
|
sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{option_results}->{url_path} = $self->{option_results}->{url_path}."_cluster/health";
|
my $jsoncontent = $self->{http}->request();
|
||||||
my $query_form_get = { level => 'indices' };
|
|
||||||
|
|
||||||
my $jsoncontent = centreon::plugins::httplib::connect($self, query_form_get => $query_form_get, connection_exit => 'critical');
|
|
||||||
|
|
||||||
my $json = JSON->new;
|
my $json = JSON->new;
|
||||||
|
|
||||||
my $webcontent;
|
my $webcontent;
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
$webcontent = $json->decode($jsoncontent);
|
$webcontent = $json->decode($jsoncontent);
|
||||||
};
|
};
|
||||||
|
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Cannot decode json response");
|
$self->{output}->add_option_msg(short_msg => "Cannot decode json response");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
@ -154,11 +129,9 @@ sub run {
|
|||||||
|
|
||||||
$self->{output}->output_add(severity => 'OK',
|
$self->{output}->output_add(severity => 'OK',
|
||||||
short_msg => sprintf("All indices are in green state."));
|
short_msg => sprintf("All indices are in green state."));
|
||||||
|
|
||||||
my $exit = 'OK';
|
my $exit = 'OK';
|
||||||
|
|
||||||
foreach my $indicename (sort (keys %{$webcontent->{indices}})) {
|
foreach my $indicename (sort (keys %{$webcontent->{indices}})) {
|
||||||
my $tmp_exit = $self->get_severity(section => 'indices', value => $webcontent->{indices}->{$indicename}->{status});
|
my $tmp_exit = $self->get_severity(section => 'indices', value => $webcontent->{indices}->{$indicename}->{status});
|
||||||
$exit = $self->{output}->get_most_critical(status => [ $tmp_exit, $exit ]);
|
$exit = $self->{output}->get_most_critical(status => [ $tmp_exit, $exit ]);
|
||||||
if (!$self->{output}->is_status(value => $tmp_exit, compare => 'OK', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $tmp_exit, compare => 'OK', litteral => 1)) {
|
||||||
$self->{output}->output_add(long_msg => sprintf("Indice %s status is in %s state",
|
$self->{output}->output_add(long_msg => sprintf("Indice %s status is in %s state",
|
||||||
@ -166,10 +139,12 @@ sub run {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{output}->output_add(severity => $exit,
|
if (!$self->{output}->is_status(value => $exit, compare => 'OK', litteral => 1)) {
|
||||||
short_msg => sprintf("One or some indices are in %s state", $map_states_indices{$exit}));
|
$self->{output}->output_add(severity => $exit,
|
||||||
|
short_msg => sprintf("Some indices are in wrong state"));
|
||||||
|
}
|
||||||
|
|
||||||
$self->{output}->display(force_long_output => 1);
|
$self->{output}->display();
|
||||||
$self->{output}->exit();
|
$self->{output}->exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2015 CENTREON
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
|
||||||
# Foundation ; either version 2 of the License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# service performance.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
#
|
||||||
# As a special exception, the copyright holders of this program give CENTREON
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# distribute the resulting timeelapsedutable under terms of CENTREON choice, provided that
|
# See the License for the specific language governing permissions and
|
||||||
# CENTREON also meet, for each linked independent module, the terms and conditions
|
# limitations under the License.
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
#
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Mathieu Cinquin <mcinquin@centreon.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::elasticsearch::mode::nodescount;
|
package apps::elasticsearch::mode::nodescount;
|
||||||
|
|
||||||
@ -39,7 +24,7 @@ use base qw(centreon::plugins::mode);
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::http;
|
||||||
use JSON;
|
use JSON;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
@ -52,16 +37,17 @@ sub new {
|
|||||||
{
|
{
|
||||||
"hostname:s" => { name => 'hostname' },
|
"hostname:s" => { name => 'hostname' },
|
||||||
"port:s" => { name => 'port', default => '9200'},
|
"port:s" => { name => 'port', default => '9200'},
|
||||||
"proto:s" => { name => 'proto', default => 'http' },
|
"proto:s" => { name => 'proto' },
|
||||||
"urlpath:s" => { name => 'url_path', default => '/' },
|
"urlpath:s" => { name => 'url_path' },
|
||||||
"credentials" => { name => 'credentials' },
|
"credentials" => { name => 'credentials' },
|
||||||
"username:s" => { name => 'username' },
|
"username:s" => { name => 'username' },
|
||||||
"password:s" => { name => 'password' },
|
"password:s" => { name => 'password' },
|
||||||
"warning:s" => { name => 'warning' },
|
"warning:s" => { name => 'warning' },
|
||||||
"critical:s" => { name => 'critical' },
|
"critical:s" => { name => 'critical' },
|
||||||
"timeout:s" => { name => 'timeout', default => '3' },
|
"timeout:s" => { name => 'timeout' },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,15 +55,6 @@ sub check_options {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
if (!defined($self->{option_results}->{hostname})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the hostname option");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if ((defined($self->{option_results}->{credentials})) && (!defined($self->{option_results}->{username}) || !defined($self->{option_results}->{password}))) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "You need to set --username= and --password= options when --credentials is used");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
@ -86,17 +63,17 @@ sub check_options {
|
|||||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$self->{option_results}->{url_path} = $self->{option_results}->{url_path} . "_cluster/stats/";
|
||||||
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{option_results}->{url_path} = $self->{option_results}->{url_path}."_cluster/stats/";
|
my $jsoncontent = $self->{http}->request();
|
||||||
|
|
||||||
my $jsoncontent = centreon::plugins::httplib::connect($self, connection_exit => 'critical');
|
|
||||||
|
|
||||||
my $json = JSON->new;
|
my $json = JSON->new;
|
||||||
|
|
||||||
my $webcontent;
|
my $webcontent;
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
@ -121,26 +98,18 @@ sub run {
|
|||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(label => "nodemasteronly",
|
$self->{output}->perfdata_add(label => "nodemasteronly",
|
||||||
value => $webcontent->{nodes}->{count}->{master_only},
|
value => $webcontent->{nodes}->{count}->{master_only},
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
|
|
||||||
min => 0,
|
min => 0,
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(label => "nodedataonly",
|
$self->{output}->perfdata_add(label => "nodedataonly",
|
||||||
value => $webcontent->{nodes}->{count}->{data_only},
|
value => $webcontent->{nodes}->{count}->{data_only},
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
|
|
||||||
min => 0,
|
min => 0,
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(label => "nodemasterdata",
|
$self->{output}->perfdata_add(label => "nodemasterdata",
|
||||||
value => $webcontent->{nodes}->{count}->{master_data},
|
value => $webcontent->{nodes}->{count}->{master_data},
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
|
|
||||||
min => 0,
|
min => 0,
|
||||||
);
|
);
|
||||||
$self->{output}->perfdata_add(label => "nodeclient",
|
$self->{output}->perfdata_add(label => "nodeclient",
|
||||||
value => $webcontent->{nodes}->{count}->{client},
|
value => $webcontent->{nodes}->{count}->{client},
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
|
|
||||||
min => 0,
|
min => 0,
|
||||||
);
|
);
|
||||||
$self->{output}->display();
|
$self->{output}->display();
|
||||||
@ -196,7 +165,7 @@ Threshold critical.
|
|||||||
|
|
||||||
=item B<--timeout>
|
=item B<--timeout>
|
||||||
|
|
||||||
Threshold for HTTP timeout (Default: 3)
|
Threshold for HTTP timeout (Default: 5)
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2015 CENTREON
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
|
||||||
# Foundation ; either version 2 of the License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# service performance.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
#
|
||||||
# As a special exception, the copyright holders of this program give CENTREON
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# permission to link this program with independent modules to produce an executable,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# distribute the resulting executable under terms of CENTREON choice, provided that
|
# See the License for the specific language governing permissions and
|
||||||
# CENTREON also meet, for each linked independent module, the terms and conditions
|
# limitations under the License.
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
#
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Mathieu Cinquin <mcinquin@centreon.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::elasticsearch::plugin;
|
package apps::elasticsearch::plugin;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::exchange::2010::local::mode::activesyncmailbox;
|
package apps::exchange::2010::local::mode::activesyncmailbox;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::exchange::2010::local::mode::databases;
|
package apps::exchange::2010::local::mode::databases;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::exchange::2010::local::mode::imapmailbox;
|
package apps::exchange::2010::local::mode::imapmailbox;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::exchange::2010::local::mode::mapimailbox;
|
package apps::exchange::2010::local::mode::mapimailbox;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::exchange::2010::local::plugin;
|
package apps::exchange::2010::local::plugin;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2015 CENTREON
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
|
||||||
# Foundation ; either version 2 of the License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# service performance.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
#
|
||||||
# As a special exception, the copyright holders of this program give CENTREON
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# distribute the resulting timeelapsedutable under terms of CENTREON choice, provided that
|
# See the License for the specific language governing permissions and
|
||||||
# CENTREON also meet, for each linked independent module, the terms and conditions
|
# limitations under the License.
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
#
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Mathieu Cinquin <mcinquin@centreon.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::github::mode::commits;
|
package apps::github::mode::commits;
|
||||||
|
|
||||||
@ -39,7 +24,7 @@ use base qw(centreon::plugins::mode);
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::http;
|
||||||
use centreon::plugins::statefile;
|
use centreon::plugins::statefile;
|
||||||
use JSON;
|
use JSON;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
@ -60,9 +45,10 @@ sub new {
|
|||||||
"password:s" => { name => 'password' },
|
"password:s" => { name => 'password' },
|
||||||
"owner:s" => { name => 'owner' },
|
"owner:s" => { name => 'owner' },
|
||||||
"repository:s" => { name => 'repository' },
|
"repository:s" => { name => 'repository' },
|
||||||
"timeout:s" => { name => 'timeout', default => '3' },
|
"timeout:s" => { name => 'timeout' },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
$self->{statefile_value} = centreon::plugins::statefile->new(%options);
|
$self->{statefile_value} = centreon::plugins::statefile->new(%options);
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
@ -72,14 +58,6 @@ sub check_options {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
if (!defined($self->{option_results}->{hostname})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the hostname option");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if ((defined($self->{option_results}->{credentials})) && (!defined($self->{option_results}->{username}) || !defined($self->{option_results}->{password}))) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "You need to set --username= and --password= options when --credentials is used");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (!defined($self->{option_results}->{repository})) {
|
if (!defined($self->{option_results}->{repository})) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the repository option");
|
$self->{output}->add_option_msg(short_msg => "Please set the repository option");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
@ -89,13 +67,15 @@ sub check_options {
|
|||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$self->{option_results}->{url_path} = "/repos/" . $self->{option_results}->{owner} . "/" . $self->{option_results}->{repository}."/commits";
|
||||||
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
$self->{statefile_value}->check_options(%options);
|
$self->{statefile_value}->check_options(%options);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{statefile_value}->read(statefile => 'github_' . $self->{option_results}->{repository} . '_' . $self->{option_results}->{owner} . '_' . centreon::plugins::httplib::get_port($self) . '_' . $self->{mode});
|
$self->{statefile_value}->read(statefile => 'github_' . $self->{option_results}->{repository} . '_' . $self->{option_results}->{owner} . '_' . $self->{http}->get_port() . '_' . $self->{mode});
|
||||||
my $old_timestamp = $self->{statefile_value}->get(name => 'last_timestamp');
|
my $old_timestamp = $self->{statefile_value}->get(name => 'last_timestamp');
|
||||||
|
|
||||||
my $new_datas = {};
|
my $new_datas = {};
|
||||||
@ -112,15 +92,10 @@ sub run {
|
|||||||
# Change date format from epoch to iso8601
|
# Change date format from epoch to iso8601
|
||||||
my $old_iso8601 = DateTime->from_epoch(epoch => $old_timestamp)."Z";
|
my $old_iso8601 = DateTime->from_epoch(epoch => $old_timestamp)."Z";
|
||||||
|
|
||||||
$self->{option_results}->{url_path} = "/repos/".$self->{option_results}->{owner}."/".$self->{option_results}->{repository}."/commits";
|
my $jsoncontent = $self->{http}->request(get_param => ['per_page=1000', 'since=' . $old_iso8601]);
|
||||||
|
|
||||||
my $query_form_get = { per_page => '1000', since => $old_iso8601 };
|
|
||||||
my $jsoncontent = centreon::plugins::httplib::connect($self, query_form_get => $query_form_get , connection_exit => 'critical');
|
|
||||||
|
|
||||||
my $json = JSON->new;
|
my $json = JSON->new;
|
||||||
|
|
||||||
my $webcontent;
|
my $webcontent;
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
$webcontent = $json->decode($jsoncontent);
|
$webcontent = $json->decode($jsoncontent);
|
||||||
};
|
};
|
||||||
@ -142,7 +117,6 @@ sub run {
|
|||||||
|
|
||||||
$self->{output}->display();
|
$self->{output}->display();
|
||||||
$self->{output}->exit();
|
$self->{output}->exit();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
@ -189,7 +163,7 @@ Specify GitHub's repository
|
|||||||
|
|
||||||
=item B<--timeout>
|
=item B<--timeout>
|
||||||
|
|
||||||
Threshold for HTTP timeout (Default: 3)
|
Threshold for HTTP timeout (Default: 5)
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2015 CENTREON
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
|
||||||
# Foundation ; either version 2 of the License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# service performance.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
#
|
||||||
# As a special exception, the copyright holders of this program give CENTREON
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# distribute the resulting timeelapsedutable under terms of CENTREON choice, provided that
|
# See the License for the specific language governing permissions and
|
||||||
# CENTREON also meet, for each linked independent module, the terms and conditions
|
# limitations under the License.
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
#
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Mathieu Cinquin <mcinquin@centreon.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::github::mode::issues;
|
package apps::github::mode::issues;
|
||||||
|
|
||||||
@ -39,7 +24,7 @@ use base qw(centreon::plugins::mode);
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::http;
|
||||||
use JSON;
|
use JSON;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
@ -61,9 +46,10 @@ sub new {
|
|||||||
"owner:s" => { name => 'owner' },
|
"owner:s" => { name => 'owner' },
|
||||||
"repository:s" => { name => 'repository' },
|
"repository:s" => { name => 'repository' },
|
||||||
"label:s" => { name => 'label', default => '' },
|
"label:s" => { name => 'label', default => '' },
|
||||||
"timeout:s" => { name => 'timeout', default => '3' },
|
"timeout:s" => { name => 'timeout' },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,14 +57,6 @@ sub check_options {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
if (!defined($self->{option_results}->{hostname})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the hostname option");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if ((defined($self->{option_results}->{credentials})) && (!defined($self->{option_results}->{username}) || !defined($self->{option_results}->{password}))) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "You need to set --username= and --password= options when --credentials is used");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (!defined($self->{option_results}->{repository})) {
|
if (!defined($self->{option_results}->{repository})) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the repository option");
|
$self->{output}->add_option_msg(short_msg => "Please set the repository option");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
@ -88,33 +66,30 @@ sub check_options {
|
|||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) {
|
if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$self->{option_results}->{url_path} = "/repos/" . $self->{option_results}->{owner} . "/" . $self->{option_results}->{repository} . "/issues";
|
||||||
|
if (defined($self->{option_results}->{label}) && $self->{option_results}->{label} ne '') {
|
||||||
|
$self->{option_results}->{get_param} = ['state=open', 'labels=' . $self->{option_results}->{label}, 'per_page=1000'];
|
||||||
|
} else {
|
||||||
|
$self->{option_results}->{get_param} = ['state=open', 'per_page=1000'];
|
||||||
|
}
|
||||||
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
|
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{option_results}->{url_path} = "/repos/".$self->{option_results}->{owner}."/".$self->{option_results}->{repository} . "/issues";
|
my $jsoncontent = $self->{http}->request();
|
||||||
|
|
||||||
my $query_form_get;
|
|
||||||
if (defined($self->{option_results}->{label}) && $self->{option_results}->{label} ne '') {
|
|
||||||
$query_form_get = { state => 'open', labels => $self->{option_results}->{label}, per_page => '1000' };
|
|
||||||
} else {
|
|
||||||
$query_form_get = { state => 'open', per_page => '1000' };
|
|
||||||
}
|
|
||||||
my $jsoncontent = centreon::plugins::httplib::connect($self, query_form_get => $query_form_get , connection_exit => 'critical');
|
|
||||||
|
|
||||||
my $json = JSON->new;
|
my $json = JSON->new;
|
||||||
|
|
||||||
my $webcontent;
|
my $webcontent;
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
$webcontent = $json->decode($jsoncontent);
|
$webcontent = $json->decode($jsoncontent);
|
||||||
};
|
};
|
||||||
@ -151,7 +126,6 @@ sub run {
|
|||||||
|
|
||||||
$self->{output}->display();
|
$self->{output}->display();
|
||||||
$self->{output}->exit();
|
$self->{output}->exit();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2015 CENTREON
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
|
||||||
# Foundation ; either version 2 of the License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# service performance.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
#
|
||||||
# As a special exception, the copyright holders of this program give CENTREON
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# distribute the resulting timeelapsedutable under terms of CENTREON choice, provided that
|
# See the License for the specific language governing permissions and
|
||||||
# CENTREON also meet, for each linked independent module, the terms and conditions
|
# limitations under the License.
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
#
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Mathieu Cinquin <mcinquin@centreon.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::github::mode::pullrequests;
|
package apps::github::mode::pullrequests;
|
||||||
|
|
||||||
@ -39,7 +24,7 @@ use base qw(centreon::plugins::mode);
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::http;
|
||||||
use JSON;
|
use JSON;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
@ -51,7 +36,7 @@ sub new {
|
|||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments =>
|
||||||
{
|
{
|
||||||
"hostname:s" => { name => 'hostname', default => 'api.github.com' },
|
"hostname:s" => { name => 'hostname', default => 'api.github.com' },
|
||||||
"port:s" => { name => 'port', default => '443'},
|
"port:s" => { name => 'port', default => '443' },
|
||||||
"proto:s" => { name => 'proto', default => 'https' },
|
"proto:s" => { name => 'proto', default => 'https' },
|
||||||
"credentials" => { name => 'credentials' },
|
"credentials" => { name => 'credentials' },
|
||||||
"username:s" => { name => 'username' },
|
"username:s" => { name => 'username' },
|
||||||
@ -60,9 +45,10 @@ sub new {
|
|||||||
"critical:s" => { name => 'critical' },
|
"critical:s" => { name => 'critical' },
|
||||||
"owner:s" => { name => 'owner' },
|
"owner:s" => { name => 'owner' },
|
||||||
"repository:s" => { name => 'repository' },
|
"repository:s" => { name => 'repository' },
|
||||||
"timeout:s" => { name => 'timeout', default => '3' },
|
"timeout:s" => { name => 'timeout' },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,14 +56,6 @@ sub check_options {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
if (!defined($self->{option_results}->{hostname})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the hostname option");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if ((defined($self->{option_results}->{credentials})) && (!defined($self->{option_results}->{username}) || !defined($self->{option_results}->{password}))) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "You need to set --username= and --password= options when --credentials is used");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (!defined($self->{option_results}->{repository})) {
|
if (!defined($self->{option_results}->{repository})) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the repository option");
|
$self->{output}->add_option_msg(short_msg => "Please set the repository option");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
@ -94,21 +72,19 @@ sub check_options {
|
|||||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$self->{option_results}->{url_path} = "/repos/".$self->{option_results}->{owner}."/".$self->{option_results}->{repository}."/pulls";
|
||||||
|
$self->{option_results}->{get_param} = ['state=open', 'per_page=1000'];
|
||||||
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{option_results}->{url_path} = "/repos/".$self->{option_results}->{owner}."/".$self->{option_results}->{repository}."/pulls";
|
my $jsoncontent = $self->{http}->request();
|
||||||
|
|
||||||
my $query_form_get = { state => 'open', per_page => '1000' };
|
|
||||||
|
|
||||||
my $jsoncontent = centreon::plugins::httplib::connect($self, query_form_get => $query_form_get , connection_exit => 'critical');
|
|
||||||
|
|
||||||
my $json = JSON->new;
|
my $json = JSON->new;
|
||||||
|
|
||||||
my $webcontent;
|
my $webcontent;
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
$webcontent = $json->decode($jsoncontent);
|
$webcontent = $json->decode($jsoncontent);
|
||||||
};
|
};
|
||||||
@ -133,7 +109,6 @@ sub run {
|
|||||||
);
|
);
|
||||||
$self->{output}->display();
|
$self->{output}->display();
|
||||||
$self->{output}->exit();
|
$self->{output}->exit();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
@ -188,7 +163,7 @@ Specify GitHub's repository
|
|||||||
|
|
||||||
=item B<--timeout>
|
=item B<--timeout>
|
||||||
|
|
||||||
Threshold for HTTP timeout (Default: 3)
|
Threshold for HTTP timeout (Default: 5)
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2015 CENTREON
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
|
||||||
# Foundation ; either version 2 of the License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# service performance.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
#
|
||||||
# As a special exception, the copyright holders of this program give CENTREON
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# distribute the resulting timeelapsedutable under terms of CENTREON choice, provided that
|
# See the License for the specific language governing permissions and
|
||||||
# CENTREON also meet, for each linked independent module, the terms and conditions
|
# limitations under the License.
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
#
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Mathieu Cinquin <mcinquin@centreon.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::github::mode::status;
|
package apps::github::mode::status;
|
||||||
|
|
||||||
@ -39,7 +24,7 @@ use base qw(centreon::plugins::mode);
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::http;
|
||||||
use JSON;
|
use JSON;
|
||||||
|
|
||||||
my $thresholds = {
|
my $thresholds = {
|
||||||
@ -65,10 +50,11 @@ sub new {
|
|||||||
"credentials" => { name => 'credentials' },
|
"credentials" => { name => 'credentials' },
|
||||||
"username:s" => { name => 'username' },
|
"username:s" => { name => 'username' },
|
||||||
"password:s" => { name => 'password' },
|
"password:s" => { name => 'password' },
|
||||||
"timeout:s" => { name => 'timeout', default => '3' },
|
"timeout:s" => { name => 'timeout' },
|
||||||
"threshold-overload:s@" => { name => 'threshold_overload' },
|
"threshold-overload:s@" => { name => 'threshold_overload' },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,15 +62,6 @@ sub check_options {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
if (!defined($self->{option_results}->{hostname})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the hostname option");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if ((defined($self->{option_results}->{credentials})) && (!defined($self->{option_results}->{username}) || !defined($self->{option_results}->{password}))) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "You need to set --username= and --password= options when --credentials is used");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$self->{overload_th} = {};
|
$self->{overload_th} = {};
|
||||||
foreach my $val (@{$self->{option_results}->{threshold_overload}}) {
|
foreach my $val (@{$self->{option_results}->{threshold_overload}}) {
|
||||||
if ($val !~ /^(.*?),(.*)$/) {
|
if ($val !~ /^(.*?),(.*)$/) {
|
||||||
@ -99,6 +76,8 @@ sub check_options {
|
|||||||
$self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section}));
|
$self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section}));
|
||||||
push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status};
|
push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
}
|
}
|
||||||
|
|
||||||
sub get_severity {
|
sub get_severity {
|
||||||
@ -125,12 +104,10 @@ sub get_severity {
|
|||||||
sub run {
|
sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $jsoncontent = centreon::plugins::httplib::connect($self, connection_exit => 'critical');
|
my $jsoncontent = $self->{http}->request();
|
||||||
|
|
||||||
my $json = JSON->new;
|
my $json = JSON->new;
|
||||||
|
|
||||||
my $webcontent;
|
my $webcontent;
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
$webcontent = $json->decode($jsoncontent);
|
$webcontent = $json->decode($jsoncontent);
|
||||||
};
|
};
|
||||||
@ -147,7 +124,6 @@ sub run {
|
|||||||
|
|
||||||
$self->{output}->display();
|
$self->{output}->display();
|
||||||
$self->{output}->exit();
|
$self->{output}->exit();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
@ -190,7 +166,7 @@ Specify password
|
|||||||
|
|
||||||
=item B<--timeout>
|
=item B<--timeout>
|
||||||
|
|
||||||
Threshold for HTTP timeout (Default: 3)
|
Threshold for HTTP timeout (Default: 5
|
||||||
|
|
||||||
=item B<--threshold-overload>
|
=item B<--threshold-overload>
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2015 CENTREON
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
|
||||||
# Foundation ; either version 2 of the License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# service performance.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
#
|
||||||
# As a special exception, the copyright holders of this program give CENTREON
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# permission to link this program with independent modules to produce an executable,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# distribute the resulting executable under terms of CENTREON choice, provided that
|
# See the License for the specific language governing permissions and
|
||||||
# CENTREON also meet, for each linked independent module, the terms and conditions
|
# limitations under the License.
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
#
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Mathieu Cinquin <mcinquin@centreon.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::github::plugin;
|
package apps::github::plugin;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : David Sabatie <dsabatie@centreon.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::hddtemp::local::mode::temperature;
|
package apps::hddtemp::local::mode::temperature;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::hddtemp::local::plugin;
|
package apps::hddtemp::local::plugin;
|
||||||
|
|
||||||
|
@ -1,39 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Author : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
# Based on De Bodt Lieven plugin
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# Based on Apache Mode by Simon BOMM
|
#
|
||||||
####################################################################################
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::hddtemp::remote::mode::listdrives;
|
package apps::hddtemp::remote::mode::listdrives;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Author : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::hddtemp::remote::mode::temperature;
|
package apps::hddtemp::remote::mode::temperature;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Author : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::hddtemp::remote::plugin;
|
package apps::hddtemp::remote::plugin;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::iis::local::mode::applicationpoolstate;
|
package apps::iis::local::mode::applicationpoolstate;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::iis::local::mode::listapplicationpools;
|
package apps::iis::local::mode::listapplicationpools;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::iis::local::mode::listsites;
|
package apps::iis::local::mode::listsites;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::iis::local::mode::webservicestatistics;
|
package apps::iis::local::mode::webservicestatistics;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::iis::local::plugin;
|
package apps::iis::local::plugin;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::iis::wsman::mode::applicationpoolstate;
|
package apps::iis::wsman::mode::applicationpoolstate;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::iis::wsman::mode::listapplicationpools;
|
package apps::iis::wsman::mode::listapplicationpools;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::iis::wsman::plugin;
|
package apps::iis::wsman::plugin;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
#
|
||||||
# Copyright 2005-2013 MERETHIS
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
#
|
||||||
# GPL Licence 2.0.
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
#
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# service performance.
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
#
|
||||||
# Foundation ; either version 2 of the License.
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
#
|
# you may not use this file except in compliance with the License.
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# You may obtain a copy of the License at
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
#
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
#
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# See the License for the specific language governing permissions and
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
# limitations under the License.
|
||||||
# General Public License cover the whole combination.
|
#
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
# Simon Bomm <sbomm@centreon.com>
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::java::peoplesoft::jmx::mode::queuelength;
|
package apps::java::peoplesoft::jmx::mode::queuelength;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
#
|
||||||
# Copyright 2005-2013 MERETHIS
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
#
|
||||||
# GPL Licence 2.0.
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
#
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# service performance.
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
#
|
||||||
# Foundation ; either version 2 of the License.
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
#
|
# you may not use this file except in compliance with the License.
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# You may obtain a copy of the License at
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
#
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
#
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# See the License for the specific language governing permissions and
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
# limitations under the License.
|
||||||
# General Public License cover the whole combination.
|
#
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
# Simon Bomm <sbomm@centreon.com>
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::java::peoplesoft::jmx::mode::sessions;
|
package apps::java::peoplesoft::jmx::mode::sessions;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Simon Bomm <sbomm@centreon.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::java::peoplesoft::jmx::plugin;
|
package apps::java::peoplesoft::jmx::plugin;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Quentin Garnier <qgarnier@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::java::weblogic::jmx::mode::workmanager;
|
package apps::java::weblogic::jmx::mode::workmanager;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2014 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Simon Bomm <sbomm@centreon.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::java::weblogic::jmx::plugin;
|
package apps::java::weblogic::jmx::plugin;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2015 CENTREON
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
|
||||||
# Foundation ; either version 2 of the License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# service performance.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
#
|
||||||
# As a special exception, the copyright holders of this program give CENTREON
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# distribute the resulting timeelapsedutable under terms of CENTREON choice, provided that
|
# See the License for the specific language governing permissions and
|
||||||
# CENTREON also meet, for each linked independent module, the terms and conditions
|
# limitations under the License.
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
#
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Author : Mathieu Cinquin <mcinquin@centreon.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::jenkins::mode::jobstate;
|
package apps::jenkins::mode::jobstate;
|
||||||
|
|
||||||
@ -39,7 +24,7 @@ use base qw(centreon::plugins::mode);
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::http;
|
||||||
use centreon::plugins::statefile;
|
use centreon::plugins::statefile;
|
||||||
use JSON;
|
use JSON;
|
||||||
|
|
||||||
@ -52,8 +37,8 @@ sub new {
|
|||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments =>
|
||||||
{
|
{
|
||||||
"hostname:s" => { name => 'hostname' },
|
"hostname:s" => { name => 'hostname' },
|
||||||
"port:s" => { name => 'port', default => '80'},
|
"port:s" => { name => 'port' },
|
||||||
"proto:s" => { name => 'proto', default => 'http' },
|
"proto:s" => { name => 'proto' },
|
||||||
"urlpath:s" => { name => 'url_path' },
|
"urlpath:s" => { name => 'url_path' },
|
||||||
"jobname:s" => { name => 'jobname' },
|
"jobname:s" => { name => 'jobname' },
|
||||||
"credentials" => { name => 'credentials' },
|
"credentials" => { name => 'credentials' },
|
||||||
@ -62,9 +47,10 @@ sub new {
|
|||||||
"warning:s" => { name => 'warning' },
|
"warning:s" => { name => 'warning' },
|
||||||
"critical:s" => { name => 'critical' },
|
"critical:s" => { name => 'critical' },
|
||||||
"checkstyle" => { name => 'checkstyle' },
|
"checkstyle" => { name => 'checkstyle' },
|
||||||
"timeout:s" => { name => 'timeout', default => '3' },
|
"timeout:s" => { name => 'timeout' },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,32 +66,23 @@ sub check_options {
|
|||||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
if (!defined($self->{option_results}->{hostname})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the hostname option");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (!defined($self->{option_results}->{jobname})) {
|
if (!defined($self->{option_results}->{jobname})) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Please set the jobname option");
|
$self->{output}->add_option_msg(short_msg => "Please set the jobname option");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
if ((defined($self->{option_results}->{credentials})) && (!defined($self->{option_results}->{username}) || !defined($self->{option_results}->{password}))) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "You need to set --username= and --password= options when --credentials is used");
|
$self->{option_results}->{url_path} = $self->{option_results}->{url_path} . "/job/" . $self->{option_results}->{jobname} . "/api/json";
|
||||||
$self->{output}->option_exit();
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
my $jsoncontent = $self->{http}->request();
|
||||||
$self->{option_results}->{url_path} = $self->{option_results}->{url_path}."/job/".$self->{option_results}->{jobname}."/api/json";
|
|
||||||
|
|
||||||
my $jsoncontent = centreon::plugins::httplib::connect($self);
|
|
||||||
|
|
||||||
my $json = JSON->new;
|
my $json = JSON->new;
|
||||||
|
|
||||||
my $webcontent;
|
my $webcontent;
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
$webcontent = $json->decode($jsoncontent);
|
$webcontent = $json->decode($jsoncontent);
|
||||||
};
|
};
|
||||||
@ -202,7 +179,7 @@ Add checkstyle's violation output and perfdata
|
|||||||
|
|
||||||
=item B<--timeout>
|
=item B<--timeout>
|
||||||
|
|
||||||
Threshold for HTTP timeout (Default: 3)
|
Threshold for HTTP timeout (Default: 5)
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2015 CENTREON
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
|
||||||
# Foundation ; either version 2 of the License.
|
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# the needs in IT infrastructure and application monitoring for
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
# service performance.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
#
|
||||||
# As a special exception, the copyright holders of this program give CENTREON
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# permission to link this program with independent modules to produce an executable,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# distribute the resulting executable under terms of CENTREON choice, provided that
|
# See the License for the specific language governing permissions and
|
||||||
# CENTREON also meet, for each linked independent module, the terms and conditions
|
# limitations under the License.
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
#
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Mathieu Cinquin <mcinquin@centreon.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::jenkins::plugin;
|
package apps::jenkins::plugin;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Kevin Duret <kduret@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::jive::sql::mode::etljobstatus;
|
package apps::jive::sql::mode::etljobstatus;
|
||||||
|
|
||||||
|
133
centreon-plugins/apps/kayako/api/mode/listdepartment.pm
Normal file
133
centreon-plugins/apps/kayako/api/mode/listdepartment.pm
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package apps::kayako::api::mode::listdepartment;
|
||||||
|
|
||||||
|
use base qw(centreon::plugins::mode);
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use centreon::plugins::http;
|
||||||
|
use XML::XPath;
|
||||||
|
use Digest::SHA qw(hmac_sha256_base64);
|
||||||
|
|
||||||
|
my %handlers = (ALRM => {} );
|
||||||
|
|
||||||
|
sub new {
|
||||||
|
my ($class, %options) = @_;
|
||||||
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
|
bless $self, $class;
|
||||||
|
|
||||||
|
$self->{version} = '1.0';
|
||||||
|
$options{options}->add_options(arguments =>
|
||||||
|
{
|
||||||
|
"hostname:s" => { name => 'hostname' },
|
||||||
|
"port:s" => { name => 'port' },
|
||||||
|
"proto:s" => { name => 'proto' },
|
||||||
|
"urlpath:s" => { name => 'url_path', default => '/api/index.php?' },
|
||||||
|
"kayako-api-key:s" => { name => 'kayako_api_key' },
|
||||||
|
"kayako-secret-key:s" => { name => 'kayako_secret_key' },
|
||||||
|
});
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub check_options {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
|
if (!defined($self->{option_results}->{kayako_api_key})) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "Please specify an API key for Kayako.");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
if (!defined($self->{option_results}->{kayako_secret_key})) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "Please specify a secret key for Kayako.");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
my $salt = '';
|
||||||
|
$salt .= int(rand(10)) for 1..10;
|
||||||
|
my $digest = hmac_sha256_base64($salt, $self->{option_results}->{kayako_secret_key});
|
||||||
|
$self->{option_results}->{url_path} .= "/Base/Department&apikey=" . $self->{option_results}->{kayako_api_key} . "&salt=" . $salt . "&signature=" . $digest . "=";
|
||||||
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
|
}
|
||||||
|
|
||||||
|
sub run {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
my $webcontent = $self->{http}->set_options(%{$self->{option_results}});
|
||||||
|
my $xp = XML::XPath->new($webcontent);
|
||||||
|
my $nodes = $xp->find('departments/department');
|
||||||
|
|
||||||
|
foreach my $actionNode ($nodes->get_nodelist) {
|
||||||
|
my ($id) = $xp->find('./id', $actionNode)->get_nodelist;
|
||||||
|
my $trim_id = centreon::plugins::misc::trim($id->string_value);
|
||||||
|
my ($title) = $xp->find('./title', $actionNode)->get_nodelist;
|
||||||
|
my $trim_title = centreon::plugins::misc::trim($title->string_value);
|
||||||
|
|
||||||
|
$self->{output}->output_add(long_msg => "'" . $trim_title . "' [id = " . $trim_id . "]");
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{output}->output_add(severity => 'OK',
|
||||||
|
short_msg => 'List department:');
|
||||||
|
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
|
||||||
|
$self->{output}->exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 MODE
|
||||||
|
|
||||||
|
List departments of kayako
|
||||||
|
|
||||||
|
=over 8
|
||||||
|
|
||||||
|
=item B<--hostname>
|
||||||
|
|
||||||
|
IP Addr/FQDN of the webserver host (required)
|
||||||
|
|
||||||
|
=item B<--port>
|
||||||
|
|
||||||
|
Port used by Apache
|
||||||
|
|
||||||
|
=item B<--proto>
|
||||||
|
|
||||||
|
Specify https if needed
|
||||||
|
|
||||||
|
=item B<--proxyurl>
|
||||||
|
|
||||||
|
Proxy URL if any
|
||||||
|
|
||||||
|
=item B<--kayako-api-url>
|
||||||
|
|
||||||
|
This is the URL you should dispatch all GET, POST, PUT & DELETE requests to.
|
||||||
|
|
||||||
|
=item B<--kayako-api-key>
|
||||||
|
|
||||||
|
This is your unique API key.
|
||||||
|
|
||||||
|
=item B<--kayako-secret-key>
|
||||||
|
|
||||||
|
The secret key is used to sign all the requests dispatched to Kayako.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=cut
|
133
centreon-plugins/apps/kayako/api/mode/listpriority.pm
Normal file
133
centreon-plugins/apps/kayako/api/mode/listpriority.pm
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package apps::kayako::api::mode::listpriority;
|
||||||
|
|
||||||
|
use base qw(centreon::plugins::mode);
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use centreon::plugins::http;
|
||||||
|
use XML::XPath;
|
||||||
|
use Digest::SHA qw(hmac_sha256_base64);
|
||||||
|
|
||||||
|
my %handlers = (ALRM => {} );
|
||||||
|
|
||||||
|
sub new {
|
||||||
|
my ($class, %options) = @_;
|
||||||
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
|
bless $self, $class;
|
||||||
|
|
||||||
|
$self->{version} = '1.0';
|
||||||
|
$options{options}->add_options(arguments =>
|
||||||
|
{
|
||||||
|
"hostname:s" => { name => 'hostname' },
|
||||||
|
"port:s" => { name => 'port' },
|
||||||
|
"proto:s" => { name => 'proto' },
|
||||||
|
"urlpath:s" => { name => 'url_path', default => '/api/index.php?' },
|
||||||
|
"kayako-api-key:s" => { name => 'kayako_api_key' },
|
||||||
|
"kayako-secret-key:s" => { name => 'kayako_secret_key' },
|
||||||
|
});
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub check_options {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
|
if (!defined($self->{option_results}->{kayako_api_key})) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "Please specify an API key for Kayako.");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
if (!defined($self->{option_results}->{kayako_secret_key})) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "Please specify a secret key for Kayako.");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
my $salt;
|
||||||
|
$salt .= int(rand(10)) for 1..10;
|
||||||
|
my $digest = hmac_sha256_base64 ($salt, $self->{option_results}->{kayako_secret_key});
|
||||||
|
$self->{option_results}->{url_path} .= "/Tickets/TicketPriority&apikey=" . $self->{option_results}->{kayako_api_key} . "&salt=" . $salt . "&signature=" . $digest . "=";
|
||||||
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
|
}
|
||||||
|
|
||||||
|
sub run {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
my $webcontent = $self->{http}->request();
|
||||||
|
my $xp = XML::XPath->new( $webcontent );
|
||||||
|
my $nodes = $xp->find('ticketpriorities/ticketpriority');
|
||||||
|
|
||||||
|
foreach my $actionNode ($nodes->get_nodelist) {
|
||||||
|
my ($id) = $xp->find('./id', $actionNode)->get_nodelist;
|
||||||
|
my $trim_id = centreon::plugins::misc::trim($id->string_value);
|
||||||
|
my ($title) = $xp->find('./title', $actionNode)->get_nodelist;
|
||||||
|
my $trim_title = centreon::plugins::misc::trim($title->string_value);
|
||||||
|
$self->{output}->output_add(long_msg => "'" . $trim_title . "' [id = " . $trim_id . "]");
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{output}->output_add(severity => 'OK',
|
||||||
|
short_msg => 'List priority:');
|
||||||
|
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
|
||||||
|
$self->{output}->exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 MODE
|
||||||
|
|
||||||
|
List departmentf of kayako
|
||||||
|
|
||||||
|
=over 8
|
||||||
|
|
||||||
|
=item B<--hostname>
|
||||||
|
|
||||||
|
IP Addr/FQDN of the webserver host (required)
|
||||||
|
|
||||||
|
=item B<--port>
|
||||||
|
|
||||||
|
Port used by Apache
|
||||||
|
|
||||||
|
=item B<--proto>
|
||||||
|
|
||||||
|
Specify https if needed
|
||||||
|
|
||||||
|
=item B<--proxyurl>
|
||||||
|
|
||||||
|
Proxy URL if any
|
||||||
|
|
||||||
|
=item B<--kayako-api-url>
|
||||||
|
|
||||||
|
This is the URL you should dispatch all GET, POST, PUT & DELETE requests to.
|
||||||
|
|
||||||
|
=item B<--kayako-api-key>
|
||||||
|
|
||||||
|
This is your unique API key.
|
||||||
|
|
||||||
|
=item B<--kayako-secret-key>
|
||||||
|
|
||||||
|
The secret key is used to sign all the requests dispatched to Kayako.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=cut
|
132
centreon-plugins/apps/kayako/api/mode/liststaff.pm
Normal file
132
centreon-plugins/apps/kayako/api/mode/liststaff.pm
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package apps::kayako::api::mode::liststaff;
|
||||||
|
|
||||||
|
use base qw(centreon::plugins::mode);
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use centreon::plugins::http;
|
||||||
|
use XML::XPath;
|
||||||
|
use Digest::SHA qw(hmac_sha256_base64);
|
||||||
|
|
||||||
|
sub new {
|
||||||
|
my ($class, %options) = @_;
|
||||||
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
|
bless $self, $class;
|
||||||
|
|
||||||
|
$self->{version} = '1.0';
|
||||||
|
$options{options}->add_options(arguments =>
|
||||||
|
{
|
||||||
|
"hostname:s" => { name => 'hostname' },
|
||||||
|
"port:s" => { name => 'port' },
|
||||||
|
"proto:s" => { name => 'proto' },
|
||||||
|
"urlpath:s" => { name => 'url_path', default => '/api/index.php?' },
|
||||||
|
"kayako-api-key:s" => { name => 'kayako_api_key' },
|
||||||
|
"kayako-secret-key:s" => { name => 'kayako_secret_key' },
|
||||||
|
});
|
||||||
|
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub check_options {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
|
if (!defined($self->{option_results}->{kayako_api_key})) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "Please specify an API key for Kayako.");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
if (!defined($self->{option_results}->{kayako_secret_key})) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "Please specify a secret key for Kayako.");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
my $salt;
|
||||||
|
$salt .= int(rand(10)) for 1..10;
|
||||||
|
my $digest = hmac_sha256_base64 ($salt, $self->{option_results}->{'kayako_secret_key'});
|
||||||
|
$self->{option_results}->{url_path} .= "/Base/Staff&apikey=" . $self->{option_results}->{kayako_api_key} . "&salt=" . $salt . "&signature=" . $digest . "=";
|
||||||
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
|
}
|
||||||
|
|
||||||
|
sub run {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
my $webcontent = $self->{http}->request();
|
||||||
|
my $xp = XML::XPath->new( $webcontent );
|
||||||
|
my $nodes = $xp->find('staffusers/staff');
|
||||||
|
|
||||||
|
foreach my $actionNode ($nodes->get_nodelist) {
|
||||||
|
my ($id) = $xp->find('./id', $actionNode)->get_nodelist;
|
||||||
|
my $trim_id = centreon::plugins::misc::trim($id->string_value);
|
||||||
|
my ($title) = $xp->find('./username', $actionNode)->get_nodelist;
|
||||||
|
my $trim_title = centreon::plugins::misc::trim($title->string_value);
|
||||||
|
$self->{output}->output_add(long_msg => "'" . $trim_title . "' [id = " . $trim_id . "]");
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{output}->output_add(severity => 'OK',
|
||||||
|
short_msg => 'List staff:');
|
||||||
|
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
|
||||||
|
$self->{output}->exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 MODE
|
||||||
|
|
||||||
|
List departmentf of kayako
|
||||||
|
|
||||||
|
=over 8
|
||||||
|
|
||||||
|
=item B<--hostname>
|
||||||
|
|
||||||
|
IP Addr/FQDN of the webserver host (required)
|
||||||
|
|
||||||
|
=item B<--port>
|
||||||
|
|
||||||
|
Port used by Apache
|
||||||
|
|
||||||
|
=item B<--proto>
|
||||||
|
|
||||||
|
Specify https if needed
|
||||||
|
|
||||||
|
=item B<--proxyurl>
|
||||||
|
|
||||||
|
Proxy URL if any
|
||||||
|
|
||||||
|
=item B<--kayako-api-url>
|
||||||
|
|
||||||
|
This is the URL you should dispatch all GET, POST, PUT & DELETE requests to.
|
||||||
|
|
||||||
|
=item B<--kayako-api-key>
|
||||||
|
|
||||||
|
This is your unique API key.
|
||||||
|
|
||||||
|
=item B<--kayako-secret-key>
|
||||||
|
|
||||||
|
The secret key is used to sign all the requests dispatched to Kayako.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=cut
|
132
centreon-plugins/apps/kayako/api/mode/liststatus.pm
Normal file
132
centreon-plugins/apps/kayako/api/mode/liststatus.pm
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package apps::kayako::api::mode::liststatus;
|
||||||
|
|
||||||
|
use base qw(centreon::plugins::mode);
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use centreon::plugins::http;
|
||||||
|
use XML::XPath;
|
||||||
|
use Digest::SHA qw(hmac_sha256_base64);
|
||||||
|
|
||||||
|
sub new {
|
||||||
|
my ($class, %options) = @_;
|
||||||
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
|
bless $self, $class;
|
||||||
|
|
||||||
|
$self->{version} = '1.0';
|
||||||
|
$options{options}->add_options(arguments =>
|
||||||
|
{
|
||||||
|
"hostname:s" => { name => 'hostname' },
|
||||||
|
"port:s" => { name => 'port' },
|
||||||
|
"proto:s" => { name => 'proto' },
|
||||||
|
"urlpath:s" => { name => 'url_path', default => '/api/index.php?' },
|
||||||
|
"kayako-api-key:s" => { name => 'kayako_api_key' },
|
||||||
|
"kayako-secret-key:s" => { name => 'kayako_secret_key' },
|
||||||
|
});
|
||||||
|
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub check_options {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
|
if (!defined($self->{option_results}->{kayako_api_key})) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "Please specify an API key for Kayako.");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
if (!defined($self->{option_results}->{kayako_secret_key})) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "Please specify a secret key for Kayako.");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
my $salt;
|
||||||
|
$salt .= int(rand(10)) for 1..10;
|
||||||
|
my $digest = hmac_sha256_base64 ($salt, $self->{option_results}->{'kayako_secret_key'});
|
||||||
|
$self->{option_results}->{'url_path'} .= "/Tickets/TicketStatus&apikey=" . $self->{option_results}->{kayako_api_key} . "&salt=" . $salt . "&signature=" . $digest . "=";
|
||||||
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
|
}
|
||||||
|
|
||||||
|
sub run {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
my $webcontent = $self->{http}->request();
|
||||||
|
my $xp = XML::XPath->new($webcontent);
|
||||||
|
my $nodes = $xp->find('ticketstatuses/ticketstatus');
|
||||||
|
|
||||||
|
foreach my $actionNode ($nodes->get_nodelist) {
|
||||||
|
my ($id) = $xp->find('./id', $actionNode)->get_nodelist;
|
||||||
|
my $trim_id = centreon::plugins::misc::trim($id->string_value);
|
||||||
|
my ($title) = $xp->find('./title', $actionNode)->get_nodelist;
|
||||||
|
my $trim_title = centreon::plugins::misc::trim($title->string_value);
|
||||||
|
$self->{output}->output_add(long_msg => "'" . $trim_title . "' [id = " . $trim_id . "]");
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{output}->output_add(severity => 'OK',
|
||||||
|
short_msg => 'List status:');
|
||||||
|
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
|
||||||
|
$self->{output}->exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 MODE
|
||||||
|
|
||||||
|
List departmentf of kayako
|
||||||
|
|
||||||
|
=over 8
|
||||||
|
|
||||||
|
=item B<--hostname>
|
||||||
|
|
||||||
|
IP Addr/FQDN of the webserver host (required)
|
||||||
|
|
||||||
|
=item B<--port>
|
||||||
|
|
||||||
|
Port used by Apache
|
||||||
|
|
||||||
|
=item B<--proto>
|
||||||
|
|
||||||
|
Specify https if needed
|
||||||
|
|
||||||
|
=item B<--proxyurl>
|
||||||
|
|
||||||
|
Proxy URL if any
|
||||||
|
|
||||||
|
=item B<--kayako-api-url>
|
||||||
|
|
||||||
|
This is the URL you should dispatch all GET, POST, PUT & DELETE requests to.
|
||||||
|
|
||||||
|
=item B<--kayako-api-key>
|
||||||
|
|
||||||
|
This is your unique API key.
|
||||||
|
|
||||||
|
=item B<--kayako-secret-key>
|
||||||
|
|
||||||
|
The secret key is used to sign all the requests dispatched to Kayako.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=cut
|
@ -1,46 +1,31 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Author : Stéphane DURET <sduret@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::kayako::mode::ticketcount;
|
package apps::kayako::api::mode::ticketcount;
|
||||||
|
|
||||||
use base qw(centreon::plugins::mode);
|
use base qw(centreon::plugins::mode);
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::statefile;
|
use centreon::plugins::statefile;
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::http;
|
||||||
use XML::XPath;
|
use XML::XPath;
|
||||||
use Digest::SHA qw(hmac_sha256_base64);
|
use Digest::SHA qw(hmac_sha256_base64);
|
||||||
use Time::Local;
|
use Time::Local;
|
||||||
@ -53,7 +38,6 @@ my @priority_filters;
|
|||||||
my $ticket_total = 0;
|
my $ticket_total = 0;
|
||||||
my %tickets;
|
my %tickets;
|
||||||
my $label;
|
my $label;
|
||||||
my %handlers = (ALRM => {} );
|
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
@ -65,7 +49,7 @@ sub new {
|
|||||||
{
|
{
|
||||||
"hostname:s" => { name => 'hostname' },
|
"hostname:s" => { name => 'hostname' },
|
||||||
"port:s" => { name => 'port' },
|
"port:s" => { name => 'port' },
|
||||||
"proto:s" => { name => 'proto', default => "http" },
|
"proto:s" => { name => 'proto' },
|
||||||
"urlpath:s" => { name => 'url_path', default => '/api/index.php?' },
|
"urlpath:s" => { name => 'url_path', default => '/api/index.php?' },
|
||||||
"kayako-api-key:s" => { name => 'kayako_api_key' },
|
"kayako-api-key:s" => { name => 'kayako_api_key' },
|
||||||
"kayako-secret-key:s" => { name => 'kayako_secret_key' },
|
"kayako-secret-key:s" => { name => 'kayako_secret_key' },
|
||||||
@ -79,82 +63,56 @@ sub new {
|
|||||||
"start-date:s" => { name => 'start_date' },
|
"start-date:s" => { name => 'start_date' },
|
||||||
"end-date:s" => { name => 'end_date' },
|
"end-date:s" => { name => 'end_date' },
|
||||||
});
|
});
|
||||||
$self->set_signal_handlers;
|
|
||||||
$self->{statefile_cache} = centreon::plugins::statefile->new(%options);
|
$self->{statefile_cache} = centreon::plugins::statefile->new(%options);
|
||||||
$self->{statefile_value} = centreon::plugins::statefile->new(%options);
|
$self->{statefile_value} = centreon::plugins::statefile->new(%options);
|
||||||
|
$self->{http} = centreon::plugins::http->new(output => $self->{output});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub set_signal_handlers {
|
|
||||||
my $self = shift;
|
|
||||||
|
|
||||||
$SIG{ALRM} = \&class_handle_ALRM;
|
|
||||||
$handlers{ALRM}->{$self} = sub { $self->handle_ALRM() };
|
|
||||||
}
|
|
||||||
|
|
||||||
sub class_handle_ALRM {
|
|
||||||
foreach (keys %{$handlers{ALRM}}) {
|
|
||||||
&{$handlers{ALRM}->{$_}}();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub handle_ALRM {
|
|
||||||
my $self = shift;
|
|
||||||
|
|
||||||
$self->{output}->output_add(severity => 'UNKNOWN',
|
|
||||||
short_msg => sprintf("Cannot finished API execution (timeout received)"));
|
|
||||||
$self->{output}->display();
|
|
||||||
$self->{output}->exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
sub check_options {
|
sub check_options {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
if (defined($self->{option_results}->{timeout}) && $self->{option_results}->{timeout} =~ /^\d+$/ &&
|
if (!defined($self->{option_results}->{kayako_api_key})) {
|
||||||
$self->{option_results}->{timeout} > 0) {
|
|
||||||
alarm($self->{option_results}->{timeout});
|
|
||||||
}
|
|
||||||
if (!defined($self->{option_results}->{'kayako_api_key'})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please specify an API key for Kayako.");
|
$self->{output}->add_option_msg(short_msg => "Please specify an API key for Kayako.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
if (!defined($self->{option_results}->{'kayako_secret_key'})) {
|
if (!defined($self->{option_results}->{kayako_secret_key})) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Please specify a secret key for Kayako.");
|
$self->{output}->add_option_msg(short_msg => "Please specify a secret key for Kayako.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
if (!defined($self->{option_results}->{'department_id'})) {
|
if (!defined($self->{option_results}->{department_id})) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Please specify at least one department ID.");
|
$self->{output}->add_option_msg(short_msg => "Please specify at least one department ID.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
if (!defined($self->{option_results}->{'staff_id'})) {
|
if (!defined($self->{option_results}->{staff_id})) {
|
||||||
$self->{option_results}->{'staff_id'} = "-1";
|
$self->{option_results}->{staff_id} = "-1";
|
||||||
}
|
}
|
||||||
if (!defined($self->{option_results}->{'status_id'})) {
|
if (!defined($self->{option_results}->{status_id})) {
|
||||||
$self->{option_results}->{'status_id'} = "-1";
|
$self->{option_results}->{status_id} = "-1";
|
||||||
}
|
}
|
||||||
if (defined($self->{option_results}->{'priority_id'})) {
|
if (defined($self->{option_results}->{priority_id})) {
|
||||||
@priority_filters = split(/,/, $self->{option_results}->{'priority_id'});
|
@priority_filters = split(/,/, $self->{option_results}->{priority_id});
|
||||||
}
|
}
|
||||||
if (defined($self->{option_results}->{'start_date'})) {
|
if (defined($self->{option_results}->{start_date})) {
|
||||||
if ($self->{option_results}->{'start_date'} !~ m/^\d{1,2}-\d{1,2}-\d{4}$/){
|
if ($self->{option_results}->{start_date} !~ m/^\d{1,2}-\d{1,2}-\d{4}$/){
|
||||||
$self->{output}->add_option_msg(short_msg => "Please specify a valid date (DD-MM-YYYY).");
|
$self->{output}->add_option_msg(short_msg => "Please specify a valid date (DD-MM-YYYY).");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
} else {
|
} else {
|
||||||
my ($mday,$mon,$year) = split(/-/, $self->{option_results}->{'start_date'});
|
my ($mday,$mon,$year) = split(/-/, $self->{option_results}->{start_date});
|
||||||
$start = $self->{option_results}->{'start_date'};
|
$start = $self->{option_results}->{start_date};
|
||||||
$self->{option_results}->{'start_date'} = timelocal(0,0,0,$mday,$mon-1,$year);
|
$self->{option_results}->{start_date} = timelocal(0,0,0,$mday,$mon-1,$year);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (defined($self->{option_results}->{'end_date'})) {
|
if (defined($self->{option_results}->{end_date})) {
|
||||||
if ($self->{option_results}->{'end_date'} !~ m/^\d{1,2}-\d{1,2}-\d{4}$/){
|
if ($self->{option_results}->{end_date} !~ m/^\d{1,2}-\d{1,2}-\d{4}$/){
|
||||||
$self->{output}->add_option_msg(short_msg => "Please specify a valid date (DD-MM-YYYY).");
|
$self->{output}->add_option_msg(short_msg => "Please specify a valid date (DD-MM-YYYY).");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
} else {
|
} else {
|
||||||
my ($mday,$mon,$year) = split(/-/, $self->{option_results}->{'end_date'});
|
my ($mday,$mon,$year) = split(/-/, $self->{option_results}->{end_date});
|
||||||
$end = $self->{option_results}->{'end_date'};
|
$end = $self->{option_results}->{end_date};
|
||||||
$self->{option_results}->{'end_date'} = timelocal(59,59,23,$mday,$mon-1,$year);
|
$self->{option_results}->{end_date} = timelocal(59,59,23,$mday,$mon-1,$year);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
||||||
@ -168,6 +126,9 @@ sub check_options {
|
|||||||
|
|
||||||
$self->{statefile_cache}->check_options(%options);
|
$self->{statefile_cache}->check_options(%options);
|
||||||
$self->{statefile_value}->check_options(%options);
|
$self->{statefile_value}->check_options(%options);
|
||||||
|
|
||||||
|
|
||||||
|
$self->{http}->set_options(%{$self->{option_results}});
|
||||||
}
|
}
|
||||||
|
|
||||||
sub reload_cache {
|
sub reload_cache {
|
||||||
@ -176,12 +137,12 @@ sub reload_cache {
|
|||||||
|
|
||||||
$datas->{last_timestamp} = time();
|
$datas->{last_timestamp} = time();
|
||||||
|
|
||||||
my $salt;
|
my $salt = '';
|
||||||
$salt .= int(rand(10)) for 1..10;
|
$salt .= int(rand(10)) for 1..10;
|
||||||
my $digest = hmac_sha256_base64 ($salt, $self->{option_results}->{'kayako_secret_key'});
|
my $digest = hmac_sha256_base64 ($salt, $self->{option_results}->{kayako_secret_key});
|
||||||
$self->{option_results}->{'url_path'} = $url_original_path . "/Base/Department&apikey=" . $self->{option_results}->{'kayako_api_key'} . "&salt=" . $salt . "&signature=" . $digest . "=";
|
my $webcontent = $self->{http}->request(url_path => $url_original_path . "/Base/Department&apikey=" . $self->{option_results}->{kayako_api_key} . "&salt=" . $salt . "&signature=" . $digest . "=";);
|
||||||
my $webcontent = centreon::plugins::httplib::connect($self);
|
|
||||||
my $xp = XML::XPath->new( $webcontent );
|
my $xp = XML::XPath->new($webcontent);
|
||||||
my $nodes = $xp->find('departments/department');
|
my $nodes = $xp->find('departments/department');
|
||||||
foreach my $actionNode ($nodes->get_nodelist) {
|
foreach my $actionNode ($nodes->get_nodelist) {
|
||||||
my ($id) = $xp->find('./id', $actionNode)->get_nodelist;
|
my ($id) = $xp->find('./id', $actionNode)->get_nodelist;
|
||||||
@ -191,8 +152,7 @@ sub reload_cache {
|
|||||||
$datas->{"department_".$trim_id} = $self->{output}->to_utf8($trim_title);
|
$datas->{"department_".$trim_id} = $self->{output}->to_utf8($trim_title);
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{option_results}->{'url_path'} = $url_original_path . "/Tickets/TicketPriority&apikey=" . $self->{option_results}->{'kayako_api_key'} . "&salt=" . $salt . "&signature=" . $digest . "=";
|
$webcontent = $self->{http}->request(url_path => $url_original_path . "/Tickets/TicketPriority&apikey=" . $self->{option_results}->{kayako_api_key} . "&salt=" . $salt . "&signature=" . $digest . "=");
|
||||||
$webcontent = centreon::plugins::httplib::connect($self);
|
|
||||||
$xp = XML::XPath->new( $webcontent );
|
$xp = XML::XPath->new( $webcontent );
|
||||||
$nodes = $xp->find('ticketpriorities/ticketpriority');
|
$nodes = $xp->find('ticketpriorities/ticketpriority');
|
||||||
foreach my $actionNode ($nodes->get_nodelist) {
|
foreach my $actionNode ($nodes->get_nodelist) {
|
||||||
@ -203,8 +163,7 @@ sub reload_cache {
|
|||||||
$datas->{"priority_".$trim_id} = $self->{output}->to_utf8($trim_title);
|
$datas->{"priority_".$trim_id} = $self->{output}->to_utf8($trim_title);
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{option_results}->{'url_path'} = $url_original_path . "/Base/Staff&apikey=" . $self->{option_results}->{'kayako_api_key'} . "&salt=" . $salt . "&signature=" . $digest . "=";
|
$webcontent = $self->{http}->request(url_path => $url_original_path . "/Base/Staff&apikey=" . $self->{option_results}->{kayako_api_key} . "&salt=" . $salt . "&signature=" . $digest . "=");
|
||||||
$webcontent = centreon::plugins::httplib::connect($self);
|
|
||||||
$xp = XML::XPath->new( $webcontent );
|
$xp = XML::XPath->new( $webcontent );
|
||||||
$nodes = $xp->find('staffusers/staff');
|
$nodes = $xp->find('staffusers/staff');
|
||||||
foreach my $actionNode ($nodes->get_nodelist) {
|
foreach my $actionNode ($nodes->get_nodelist) {
|
||||||
@ -215,8 +174,7 @@ sub reload_cache {
|
|||||||
$datas->{"staff_".$trim_id} = $self->{output}->to_utf8($trim_title);
|
$datas->{"staff_".$trim_id} = $self->{output}->to_utf8($trim_title);
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{option_results}->{'url_path'} = $url_original_path . "/Tickets/TicketStatus&apikey=" . $self->{option_results}->{'kayako_api_key'} . "&salt=" . $salt . "&signature=" . $digest . "=";
|
$webcontent = $self->{http}->request(url_path => $url_original_path . "/Tickets/TicketStatus&apikey=" . $self->{option_results}->{kayako_api_key} . "&salt=" . $salt . "&signature=" . $digest . "=");
|
||||||
$webcontent = centreon::plugins::httplib::connect($self);
|
|
||||||
$xp = XML::XPath->new( $webcontent );
|
$xp = XML::XPath->new( $webcontent );
|
||||||
$nodes = $xp->find('ticketstatuses/ticketstatus');
|
$nodes = $xp->find('ticketstatuses/ticketstatus');
|
||||||
foreach my $actionNode ($nodes->get_nodelist) {
|
foreach my $actionNode ($nodes->get_nodelist) {
|
||||||
@ -232,10 +190,10 @@ sub reload_cache {
|
|||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
my $salt;
|
my $salt = '';
|
||||||
$salt .= int(rand(10)) for 1..10;
|
$salt .= int(rand(10)) for 1..10;
|
||||||
my $digest = hmac_sha256_base64 ($salt, $self->{option_results}->{'kayako_secret_key'});
|
my $digest = hmac_sha256_base64($salt, $self->{option_results}->{kayako_secret_key});
|
||||||
$url_original_path = $self->{option_results}->{'url_path'};
|
$url_original_path = $self->{option_results}->{url_path};
|
||||||
|
|
||||||
my $has_cache_file = $self->{statefile_cache}->read(statefile => 'cache_api_' . ($self->{option_results}->{hostname}) . '_kayako');
|
my $has_cache_file = $self->{statefile_cache}->read(statefile => 'cache_api_' . ($self->{option_results}->{hostname}) . '_kayako');
|
||||||
my $timestamp_cache = $self->{statefile_cache}->get(name => 'last_timestamp');
|
my $timestamp_cache = $self->{statefile_cache}->get(name => 'last_timestamp');
|
||||||
@ -245,8 +203,7 @@ sub run {
|
|||||||
$self->{statefile_cache}->read();
|
$self->{statefile_cache}->read();
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{option_results}->{'url_path'} = $url_original_path . "/Tickets/Ticket/ListAll/" . $self->{option_results}->{'department_id'} . "/" . $self->{option_results}->{'status_id'} . "/" . $self->{option_results}->{'staff_id'} . "/-1/-1/1420120620/-1/-1&apikey=" . $self->{option_results}->{'kayako_api_key'} . "&salt=" . $salt . "&signature=" . $digest . "=";
|
my $webcontent = $self->{http}->request(url_path => $url_original_path . "/Tickets/Ticket/ListAll/" . $self->{option_results}->{department_id} . "/" . $self->{option_results}->{status_id} . "/" . $self->{option_results}->{staff_id} . "/-1/-1/1420120620/-1/-1&apikey=" . $self->{option_results}->{kayako_api_key} . "&salt=" . $salt . "&signature=" . $digest . "=");
|
||||||
my $webcontent = centreon::plugins::httplib::connect($self);
|
|
||||||
my $xp = XML::XPath->new( $webcontent );
|
my $xp = XML::XPath->new( $webcontent );
|
||||||
my $nodes = $xp->find('tickets/ticket');
|
my $nodes = $xp->find('tickets/ticket');
|
||||||
|
|
||||||
@ -258,9 +215,9 @@ sub run {
|
|||||||
my $trim_priorityid = centreon::plugins::misc::trim($priorityid->string_value);
|
my $trim_priorityid = centreon::plugins::misc::trim($priorityid->string_value);
|
||||||
my ($date) = $xp->find('./lastactivity', $actionNode)->get_nodelist;
|
my ($date) = $xp->find('./lastactivity', $actionNode)->get_nodelist;
|
||||||
my $trim_date = centreon::plugins::misc::trim($date->string_value);
|
my $trim_date = centreon::plugins::misc::trim($date->string_value);
|
||||||
if (defined($self->{option_results}->{'start_date'}) and (defined($self->{option_results}->{'end_date'}))) {
|
if (defined($self->{option_results}->{start_date}) and (defined($self->{option_results}->{end_date}))) {
|
||||||
if ($trim_date > $self->{option_results}->{'start_date'} and $trim_date < $self->{option_results}->{'end_date'}) {
|
if ($trim_date > $self->{option_results}->{start_date} and $trim_date < $self->{option_results}->{end_date}) {
|
||||||
if (defined($self->{option_results}->{'priority_id'})){
|
if (defined($self->{option_results}->{priority_id})){
|
||||||
foreach $priority_filter (@priority_filters) {
|
foreach $priority_filter (@priority_filters) {
|
||||||
if ($priority_filter == $trim_priorityid){
|
if ($priority_filter == $trim_priorityid){
|
||||||
$tickets{$priority_filter}++;
|
$tickets{$priority_filter}++;
|
||||||
@ -271,9 +228,9 @@ sub run {
|
|||||||
$ticket_total++;
|
$ticket_total++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elsif (defined($self->{option_results}->{'start_date'}) and (!defined($self->{option_results}->{'end_date'}))) {
|
} elsif (defined($self->{option_results}->{start_date}) and (!defined($self->{option_results}->{end_date}))) {
|
||||||
if ($trim_date > $self->{option_results}->{'start_date'}) {
|
if ($trim_date > $self->{option_results}->{start_date}) {
|
||||||
if (defined($self->{option_results}->{'priority_id'})){
|
if (defined($self->{option_results}->{priority_id})){
|
||||||
foreach $priority_filter (@priority_filters) {
|
foreach $priority_filter (@priority_filters) {
|
||||||
if ($priority_filter == $trim_priorityid){
|
if ($priority_filter == $trim_priorityid){
|
||||||
$tickets{$priority_filter}++;
|
$tickets{$priority_filter}++;
|
||||||
@ -284,9 +241,9 @@ sub run {
|
|||||||
$ticket_total++;
|
$ticket_total++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elsif (!defined($self->{option_results}->{'start_date'}) and (defined($self->{option_results}->{'end_date'}))) {
|
} elsif (!defined($self->{option_results}->{start_date}) and (defined($self->{option_results}->{end_date}))) {
|
||||||
if ($trim_date < $self->{option_results}->{'end_date'}) {
|
if ($trim_date < $self->{option_results}->{end_date}) {
|
||||||
if (defined($self->{option_results}->{'priority_id'})){
|
if (defined($self->{option_results}->{priority_id})){
|
||||||
foreach $priority_filter (@priority_filters) {
|
foreach $priority_filter (@priority_filters) {
|
||||||
if ($priority_filter == $trim_priorityid){
|
if ($priority_filter == $trim_priorityid){
|
||||||
$tickets{$priority_filter}++;
|
$tickets{$priority_filter}++;
|
||||||
@ -298,7 +255,7 @@ sub run {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (defined($self->{option_results}->{'priority_id'})){
|
if (defined($self->{option_results}->{priority_id})){
|
||||||
foreach $priority_filter (@priority_filters) {
|
foreach $priority_filter (@priority_filters) {
|
||||||
if ($priority_filter == $trim_priorityid){
|
if ($priority_filter == $trim_priorityid){
|
||||||
$tickets{$priority_filter}++;
|
$tickets{$priority_filter}++;
|
||||||
@ -314,32 +271,32 @@ sub run {
|
|||||||
###########
|
###########
|
||||||
# Manage Output
|
# Manage Output
|
||||||
###########
|
###########
|
||||||
my $exit = $self->{perfdata}->threshold_check(value => $ticket_total, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
my $exit = $self->{perfdata}->threshold_check(value => $ticket_total, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
||||||
my $staff = "";
|
my $staff = "";
|
||||||
my $ticket_status = "";
|
my $ticket_status = "";
|
||||||
my $period = "";
|
my $period = "";
|
||||||
|
|
||||||
if (defined($self->{option_results}->{'staff_id'}) && ($self->{option_results}->{'staff_id'} =~ m/^\d*$/)) {
|
if (defined($self->{option_results}->{staff_id}) && ($self->{option_results}->{staff_id} =~ m/^\d*$/)) {
|
||||||
$staff = " for staff '" . $self->{statefile_cache}->get(name => 'staff_'.$self->{option_results}->{'staff_id'}) ."'";
|
$staff = " for staff '" . $self->{statefile_cache}->get(name => 'staff_'.$self->{option_results}->{staff_id}) ."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined($self->{option_results}->{'status_id'}) && ($self->{option_results}->{'status_id'} =~ m/^\d*$/)) {
|
if (defined($self->{option_results}->{status_id}) && ($self->{option_results}->{status_id} =~ m/^\d*$/)) {
|
||||||
$ticket_status = " in status '" . $self->{statefile_cache}->get(name => 'status_'.$self->{option_results}->{'status_id'}) ."'";
|
$ticket_status = " in status '" . $self->{statefile_cache}->get(name => 'status_'.$self->{option_results}->{status_id}) ."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined($self->{option_results}->{'start_date'}) || defined($self->{option_results}->{'end_date'})){
|
if (defined($self->{option_results}->{start_date}) || defined($self->{option_results}->{end_date})){
|
||||||
$period = " -";
|
$period = " -";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined($self->{option_results}->{'start_date'})){
|
if (defined($self->{option_results}->{start_date})){
|
||||||
$start = " Start: " . $start;
|
$start = " Start: " . $start;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined($self->{option_results}->{'end_date'})){
|
if (defined($self->{option_results}->{end_date})){
|
||||||
$end = " End: " . $end;
|
$end = " End: " . $end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined($self->{option_results}->{'priority_id'})){
|
if (defined($self->{option_results}->{priority_id})){
|
||||||
foreach $priority_filter (@priority_filters) {
|
foreach $priority_filter (@priority_filters) {
|
||||||
$label = $self->{statefile_cache}->get(name => 'priority_'.$priority_filter);
|
$label = $self->{statefile_cache}->get(name => 'priority_'.$priority_filter);
|
||||||
$self->{output}->perfdata_add(label => $label, value => $tickets{$priority_filter},
|
$self->{output}->perfdata_add(label => $label, value => $tickets{$priority_filter},
|
53
centreon-plugins/apps/kayako/api/plugin.pm
Normal file
53
centreon-plugins/apps/kayako/api/plugin.pm
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package apps::kayako::api::plugin;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use base qw(centreon::plugins::script_simple);
|
||||||
|
|
||||||
|
sub new {
|
||||||
|
my ($class, %options) = @_;
|
||||||
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
|
bless $self, $class;
|
||||||
|
# $options->{options} = options object
|
||||||
|
|
||||||
|
$self->{version} = '0.1';
|
||||||
|
%{$self->{modes}} = (
|
||||||
|
'list-department' => 'apps::kayako::api::mode::listdepartment',
|
||||||
|
'list-priority' => 'apps::kayako::api::mode::listpriority',
|
||||||
|
'list-staff' => 'apps::kayako::api::mode::liststaff',
|
||||||
|
'list-status' => 'apps::kayako::api::mode::liststatus',
|
||||||
|
'ticket-count' => 'apps::kayako::api::mode::ticketcount',
|
||||||
|
);
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 PLUGIN DESCRIPTION
|
||||||
|
|
||||||
|
Check Kayako with REST API.
|
||||||
|
|
||||||
|
=cut
|
@ -1,173 +0,0 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Author : Stéphane DURET <sduret@merethis.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::kayako::mode::listdepartment;
|
|
||||||
|
|
||||||
use base qw(centreon::plugins::mode);
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use centreon::plugins::httplib;
|
|
||||||
use XML::XPath;
|
|
||||||
use Digest::SHA qw(hmac_sha256_base64);
|
|
||||||
|
|
||||||
my %handlers = (ALRM => {} );
|
|
||||||
|
|
||||||
sub new {
|
|
||||||
my ($class, %options) = @_;
|
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
|
||||||
bless $self, $class;
|
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
|
||||||
$options{options}->add_options(arguments =>
|
|
||||||
{
|
|
||||||
"hostname:s" => { name => 'hostname' },
|
|
||||||
"port:s" => { name => 'port' },
|
|
||||||
"proto:s" => { name => 'proto', default => "http" },
|
|
||||||
"urlpath:s" => { name => 'url_path', default => '/api/index.php?' },
|
|
||||||
"kayako-api-key:s" => { name => 'kayako_api_key' },
|
|
||||||
"kayako-secret-key:s" => { name => 'kayako_secret_key' },
|
|
||||||
});
|
|
||||||
$self->set_signal_handlers;
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub set_signal_handlers {
|
|
||||||
my $self = shift;
|
|
||||||
|
|
||||||
$SIG{ALRM} = \&class_handle_ALRM;
|
|
||||||
$handlers{ALRM}->{$self} = sub { $self->handle_ALRM() };
|
|
||||||
}
|
|
||||||
|
|
||||||
sub class_handle_ALRM {
|
|
||||||
foreach (keys %{$handlers{ALRM}}) {
|
|
||||||
&{$handlers{ALRM}->{$_}}();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub handle_ALRM {
|
|
||||||
my $self = shift;
|
|
||||||
|
|
||||||
$self->{output}->output_add(severity => 'UNKNOWN',
|
|
||||||
short_msg => sprintf("Cannot finished API execution (timeout received)"));
|
|
||||||
$self->{output}->display();
|
|
||||||
$self->{output}->exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::init(%options);
|
|
||||||
|
|
||||||
if (defined($self->{option_results}->{timeout}) && $self->{option_results}->{timeout} =~ /^\d+$/ &&
|
|
||||||
$self->{option_results}->{timeout} > 0) {
|
|
||||||
alarm($self->{option_results}->{timeout});
|
|
||||||
}
|
|
||||||
if (!defined($self->{option_results}->{'kayako_api_key'})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please specify an API key for Kayako.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (!defined($self->{option_results}->{'kayako_secret_key'})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please specify a secret key for Kayako.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub run {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
my $salt;
|
|
||||||
$salt .= int(rand(10)) for 1..10;
|
|
||||||
my $digest = hmac_sha256_base64 ($salt, $self->{option_results}->{'kayako_secret_key'});
|
|
||||||
$self->{option_results}->{'url_path'} .= "/Base/Department&apikey=" . $self->{option_results}->{'kayako_api_key'} . "&salt=" . $salt . "&signature=" . $digest . "=";
|
|
||||||
my $webcontent = centreon::plugins::httplib::connect($self);
|
|
||||||
my $xp = XML::XPath->new( $webcontent );
|
|
||||||
my $nodes = $xp->find('departments/department');
|
|
||||||
|
|
||||||
foreach my $actionNode ($nodes->get_nodelist) {
|
|
||||||
my ($id) = $xp->find('./id', $actionNode)->get_nodelist;
|
|
||||||
my $trim_id = centreon::plugins::misc::trim($id->string_value);
|
|
||||||
my ($title) = $xp->find('./title', $actionNode)->get_nodelist;
|
|
||||||
my $trim_title = centreon::plugins::misc::trim($title->string_value);
|
|
||||||
# print $trim_id." : ". $trim_title."\n";
|
|
||||||
# }
|
|
||||||
$self->{output}->output_add(long_msg => "'" . $trim_title . "' [id = " . $trim_id . "]");
|
|
||||||
}
|
|
||||||
|
|
||||||
$self->{output}->output_add(severity => 'OK',
|
|
||||||
short_msg => 'List department:');
|
|
||||||
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
|
|
||||||
$self->{output}->exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
|
||||||
|
|
||||||
__END__
|
|
||||||
|
|
||||||
=head1 MODE
|
|
||||||
|
|
||||||
List departmentf of kayako
|
|
||||||
|
|
||||||
=over 8
|
|
||||||
|
|
||||||
=item B<--hostname>
|
|
||||||
|
|
||||||
IP Addr/FQDN of the webserver host (required)
|
|
||||||
|
|
||||||
=item B<--port>
|
|
||||||
|
|
||||||
Port used by Apache
|
|
||||||
|
|
||||||
=item B<--proto>
|
|
||||||
|
|
||||||
Specify https if needed
|
|
||||||
|
|
||||||
=item B<--proxyurl>
|
|
||||||
|
|
||||||
Proxy URL if any
|
|
||||||
|
|
||||||
=item B<--kayako-api-url>
|
|
||||||
|
|
||||||
This is the URL you should dispatch all GET, POST, PUT & DELETE requests to.
|
|
||||||
|
|
||||||
=item B<--kayako-api-key>
|
|
||||||
|
|
||||||
This is your unique API key.
|
|
||||||
|
|
||||||
=item B<--kayako-secret-key>
|
|
||||||
|
|
||||||
The secret key is used to sign all the requests dispatched to Kayako.
|
|
||||||
|
|
||||||
=back
|
|
||||||
|
|
||||||
=cut
|
|
@ -1,171 +0,0 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Author : Stéphane DURET <sduret@merethis.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::kayako::mode::listpriority;
|
|
||||||
|
|
||||||
use base qw(centreon::plugins::mode);
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use centreon::plugins::httplib;
|
|
||||||
use XML::XPath;
|
|
||||||
use Digest::SHA qw(hmac_sha256_base64);
|
|
||||||
|
|
||||||
my %handlers = (ALRM => {} );
|
|
||||||
|
|
||||||
sub new {
|
|
||||||
my ($class, %options) = @_;
|
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
|
||||||
bless $self, $class;
|
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
|
||||||
$options{options}->add_options(arguments =>
|
|
||||||
{
|
|
||||||
"hostname:s" => { name => 'hostname' },
|
|
||||||
"port:s" => { name => 'port' },
|
|
||||||
"proto:s" => { name => 'proto', default => "http" },
|
|
||||||
"urlpath:s" => { name => 'url_path', default => '/api/index.php?' },
|
|
||||||
"kayako-api-key:s" => { name => 'kayako_api_key' },
|
|
||||||
"kayako-secret-key:s" => { name => 'kayako_secret_key' },
|
|
||||||
});
|
|
||||||
$self->set_signal_handlers;
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub set_signal_handlers {
|
|
||||||
my $self = shift;
|
|
||||||
|
|
||||||
$SIG{ALRM} = \&class_handle_ALRM;
|
|
||||||
$handlers{ALRM}->{$self} = sub { $self->handle_ALRM() };
|
|
||||||
}
|
|
||||||
|
|
||||||
sub class_handle_ALRM {
|
|
||||||
foreach (keys %{$handlers{ALRM}}) {
|
|
||||||
&{$handlers{ALRM}->{$_}}();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub handle_ALRM {
|
|
||||||
my $self = shift;
|
|
||||||
|
|
||||||
$self->{output}->output_add(severity => 'UNKNOWN',
|
|
||||||
short_msg => sprintf("Cannot finished API execution (timeout received)"));
|
|
||||||
$self->{output}->display();
|
|
||||||
$self->{output}->exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::init(%options);
|
|
||||||
|
|
||||||
if (defined($self->{option_results}->{timeout}) && $self->{option_results}->{timeout} =~ /^\d+$/ &&
|
|
||||||
$self->{option_results}->{timeout} > 0) {
|
|
||||||
alarm($self->{option_results}->{timeout});
|
|
||||||
}
|
|
||||||
if (!defined($self->{option_results}->{'kayako_api_key'})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please specify an API key for Kayako.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (!defined($self->{option_results}->{'kayako_secret_key'})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please specify a secret key for Kayako.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub run {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
my $salt;
|
|
||||||
$salt .= int(rand(10)) for 1..10;
|
|
||||||
my $digest = hmac_sha256_base64 ($salt, $self->{option_results}->{'kayako_secret_key'});
|
|
||||||
$self->{option_results}->{'url_path'} .= "/Tickets/TicketPriority&apikey=" . $self->{option_results}->{'kayako_api_key'} . "&salt=" . $salt . "&signature=" . $digest . "=";
|
|
||||||
my $webcontent = centreon::plugins::httplib::connect($self);
|
|
||||||
my $xp = XML::XPath->new( $webcontent );
|
|
||||||
my $nodes = $xp->find('ticketpriorities/ticketpriority');
|
|
||||||
|
|
||||||
foreach my $actionNode ($nodes->get_nodelist) {
|
|
||||||
my ($id) = $xp->find('./id', $actionNode)->get_nodelist;
|
|
||||||
my $trim_id = centreon::plugins::misc::trim($id->string_value);
|
|
||||||
my ($title) = $xp->find('./title', $actionNode)->get_nodelist;
|
|
||||||
my $trim_title = centreon::plugins::misc::trim($title->string_value);
|
|
||||||
$self->{output}->output_add(long_msg => "'" . $trim_title . "' [id = " . $trim_id . "]");
|
|
||||||
}
|
|
||||||
|
|
||||||
$self->{output}->output_add(severity => 'OK',
|
|
||||||
short_msg => 'List priority:');
|
|
||||||
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
|
|
||||||
$self->{output}->exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
|
||||||
|
|
||||||
__END__
|
|
||||||
|
|
||||||
=head1 MODE
|
|
||||||
|
|
||||||
List departmentf of kayako
|
|
||||||
|
|
||||||
=over 8
|
|
||||||
|
|
||||||
=item B<--hostname>
|
|
||||||
|
|
||||||
IP Addr/FQDN of the webserver host (required)
|
|
||||||
|
|
||||||
=item B<--port>
|
|
||||||
|
|
||||||
Port used by Apache
|
|
||||||
|
|
||||||
=item B<--proto>
|
|
||||||
|
|
||||||
Specify https if needed
|
|
||||||
|
|
||||||
=item B<--proxyurl>
|
|
||||||
|
|
||||||
Proxy URL if any
|
|
||||||
|
|
||||||
=item B<--kayako-api-url>
|
|
||||||
|
|
||||||
This is the URL you should dispatch all GET, POST, PUT & DELETE requests to.
|
|
||||||
|
|
||||||
=item B<--kayako-api-key>
|
|
||||||
|
|
||||||
This is your unique API key.
|
|
||||||
|
|
||||||
=item B<--kayako-secret-key>
|
|
||||||
|
|
||||||
The secret key is used to sign all the requests dispatched to Kayako.
|
|
||||||
|
|
||||||
=back
|
|
||||||
|
|
||||||
=cut
|
|
@ -1,171 +0,0 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Author : Stéphane DURET <sduret@merethis.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::kayako::mode::liststaff;
|
|
||||||
|
|
||||||
use base qw(centreon::plugins::mode);
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use centreon::plugins::httplib;
|
|
||||||
use XML::XPath;
|
|
||||||
use Digest::SHA qw(hmac_sha256_base64);
|
|
||||||
|
|
||||||
my %handlers = (ALRM => {} );
|
|
||||||
|
|
||||||
sub new {
|
|
||||||
my ($class, %options) = @_;
|
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
|
||||||
bless $self, $class;
|
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
|
||||||
$options{options}->add_options(arguments =>
|
|
||||||
{
|
|
||||||
"hostname:s" => { name => 'hostname' },
|
|
||||||
"port:s" => { name => 'port' },
|
|
||||||
"proto:s" => { name => 'proto', default => "http" },
|
|
||||||
"urlpath:s" => { name => 'url_path', default => '/api/index.php?' },
|
|
||||||
"kayako-api-key:s" => { name => 'kayako_api_key' },
|
|
||||||
"kayako-secret-key:s" => { name => 'kayako_secret_key' },
|
|
||||||
});
|
|
||||||
$self->set_signal_handlers;
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub set_signal_handlers {
|
|
||||||
my $self = shift;
|
|
||||||
|
|
||||||
$SIG{ALRM} = \&class_handle_ALRM;
|
|
||||||
$handlers{ALRM}->{$self} = sub { $self->handle_ALRM() };
|
|
||||||
}
|
|
||||||
|
|
||||||
sub class_handle_ALRM {
|
|
||||||
foreach (keys %{$handlers{ALRM}}) {
|
|
||||||
&{$handlers{ALRM}->{$_}}();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub handle_ALRM {
|
|
||||||
my $self = shift;
|
|
||||||
|
|
||||||
$self->{output}->output_add(severity => 'UNKNOWN',
|
|
||||||
short_msg => sprintf("Cannot finished API execution (timeout received)"));
|
|
||||||
$self->{output}->display();
|
|
||||||
$self->{output}->exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::init(%options);
|
|
||||||
|
|
||||||
if (defined($self->{option_results}->{timeout}) && $self->{option_results}->{timeout} =~ /^\d+$/ &&
|
|
||||||
$self->{option_results}->{timeout} > 0) {
|
|
||||||
alarm($self->{option_results}->{timeout});
|
|
||||||
}
|
|
||||||
if (!defined($self->{option_results}->{'kayako_api_key'})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please specify an API key for Kayako.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (!defined($self->{option_results}->{'kayako_secret_key'})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please specify a secret key for Kayako.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub run {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
my $salt;
|
|
||||||
$salt .= int(rand(10)) for 1..10;
|
|
||||||
my $digest = hmac_sha256_base64 ($salt, $self->{option_results}->{'kayako_secret_key'});
|
|
||||||
$self->{option_results}->{'url_path'} .= "/Base/Staff&apikey=" . $self->{option_results}->{'kayako_api_key'} . "&salt=" . $salt . "&signature=" . $digest . "=";
|
|
||||||
my $webcontent = centreon::plugins::httplib::connect($self);
|
|
||||||
my $xp = XML::XPath->new( $webcontent );
|
|
||||||
my $nodes = $xp->find('staffusers/staff');
|
|
||||||
|
|
||||||
foreach my $actionNode ($nodes->get_nodelist) {
|
|
||||||
my ($id) = $xp->find('./id', $actionNode)->get_nodelist;
|
|
||||||
my $trim_id = centreon::plugins::misc::trim($id->string_value);
|
|
||||||
my ($title) = $xp->find('./username', $actionNode)->get_nodelist;
|
|
||||||
my $trim_title = centreon::plugins::misc::trim($title->string_value);
|
|
||||||
$self->{output}->output_add(long_msg => "'" . $trim_title . "' [id = " . $trim_id . "]");
|
|
||||||
}
|
|
||||||
|
|
||||||
$self->{output}->output_add(severity => 'OK',
|
|
||||||
short_msg => 'List staff:');
|
|
||||||
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
|
|
||||||
$self->{output}->exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
|
||||||
|
|
||||||
__END__
|
|
||||||
|
|
||||||
=head1 MODE
|
|
||||||
|
|
||||||
List departmentf of kayako
|
|
||||||
|
|
||||||
=over 8
|
|
||||||
|
|
||||||
=item B<--hostname>
|
|
||||||
|
|
||||||
IP Addr/FQDN of the webserver host (required)
|
|
||||||
|
|
||||||
=item B<--port>
|
|
||||||
|
|
||||||
Port used by Apache
|
|
||||||
|
|
||||||
=item B<--proto>
|
|
||||||
|
|
||||||
Specify https if needed
|
|
||||||
|
|
||||||
=item B<--proxyurl>
|
|
||||||
|
|
||||||
Proxy URL if any
|
|
||||||
|
|
||||||
=item B<--kayako-api-url>
|
|
||||||
|
|
||||||
This is the URL you should dispatch all GET, POST, PUT & DELETE requests to.
|
|
||||||
|
|
||||||
=item B<--kayako-api-key>
|
|
||||||
|
|
||||||
This is your unique API key.
|
|
||||||
|
|
||||||
=item B<--kayako-secret-key>
|
|
||||||
|
|
||||||
The secret key is used to sign all the requests dispatched to Kayako.
|
|
||||||
|
|
||||||
=back
|
|
||||||
|
|
||||||
=cut
|
|
@ -1,171 +0,0 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an timeelapsedutable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting timeelapsedutable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Author : Stéphane DURET <sduret@merethis.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::kayako::mode::liststatus;
|
|
||||||
|
|
||||||
use base qw(centreon::plugins::mode);
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use centreon::plugins::httplib;
|
|
||||||
use XML::XPath;
|
|
||||||
use Digest::SHA qw(hmac_sha256_base64);
|
|
||||||
|
|
||||||
my %handlers = (ALRM => {} );
|
|
||||||
|
|
||||||
sub new {
|
|
||||||
my ($class, %options) = @_;
|
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
|
||||||
bless $self, $class;
|
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
|
||||||
$options{options}->add_options(arguments =>
|
|
||||||
{
|
|
||||||
"hostname:s" => { name => 'hostname' },
|
|
||||||
"port:s" => { name => 'port' },
|
|
||||||
"proto:s" => { name => 'proto', default => "http" },
|
|
||||||
"urlpath:s" => { name => 'url_path', default => '/api/index.php?' },
|
|
||||||
"kayako-api-key:s" => { name => 'kayako_api_key' },
|
|
||||||
"kayako-secret-key:s" => { name => 'kayako_secret_key' },
|
|
||||||
});
|
|
||||||
$self->set_signal_handlers;
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub set_signal_handlers {
|
|
||||||
my $self = shift;
|
|
||||||
|
|
||||||
$SIG{ALRM} = \&class_handle_ALRM;
|
|
||||||
$handlers{ALRM}->{$self} = sub { $self->handle_ALRM() };
|
|
||||||
}
|
|
||||||
|
|
||||||
sub class_handle_ALRM {
|
|
||||||
foreach (keys %{$handlers{ALRM}}) {
|
|
||||||
&{$handlers{ALRM}->{$_}}();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub handle_ALRM {
|
|
||||||
my $self = shift;
|
|
||||||
|
|
||||||
$self->{output}->output_add(severity => 'UNKNOWN',
|
|
||||||
short_msg => sprintf("Cannot finished scenario execution (timeout received)"));
|
|
||||||
$self->{output}->display();
|
|
||||||
$self->{output}->exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::init(%options);
|
|
||||||
|
|
||||||
if (defined($self->{option_results}->{timeout}) && $self->{option_results}->{timeout} =~ /^\d+$/ &&
|
|
||||||
$self->{option_results}->{timeout} > 0) {
|
|
||||||
alarm($self->{option_results}->{timeout});
|
|
||||||
}
|
|
||||||
if (!defined($self->{option_results}->{'kayako_api_key'})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please specify an API key for Kayako.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (!defined($self->{option_results}->{'kayako_secret_key'})) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Please specify a secret key for Kayako.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub run {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
my $salt;
|
|
||||||
$salt .= int(rand(10)) for 1..10;
|
|
||||||
my $digest = hmac_sha256_base64 ($salt, $self->{option_results}->{'kayako_secret_key'});
|
|
||||||
$self->{option_results}->{'url_path'} .= "/Tickets/TicketStatus&apikey=" . $self->{option_results}->{'kayako_api_key'} . "&salt=" . $salt . "&signature=" . $digest . "=";
|
|
||||||
my $webcontent = centreon::plugins::httplib::connect($self);
|
|
||||||
my $xp = XML::XPath->new( $webcontent );
|
|
||||||
my $nodes = $xp->find('ticketstatuses/ticketstatus');
|
|
||||||
|
|
||||||
foreach my $actionNode ($nodes->get_nodelist) {
|
|
||||||
my ($id) = $xp->find('./id', $actionNode)->get_nodelist;
|
|
||||||
my $trim_id = centreon::plugins::misc::trim($id->string_value);
|
|
||||||
my ($title) = $xp->find('./title', $actionNode)->get_nodelist;
|
|
||||||
my $trim_title = centreon::plugins::misc::trim($title->string_value);
|
|
||||||
$self->{output}->output_add(long_msg => "'" . $trim_title . "' [id = " . $trim_id . "]");
|
|
||||||
}
|
|
||||||
|
|
||||||
$self->{output}->output_add(severity => 'OK',
|
|
||||||
short_msg => 'List status:');
|
|
||||||
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
|
|
||||||
$self->{output}->exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
|
||||||
|
|
||||||
__END__
|
|
||||||
|
|
||||||
=head1 MODE
|
|
||||||
|
|
||||||
List departmentf of kayako
|
|
||||||
|
|
||||||
=over 8
|
|
||||||
|
|
||||||
=item B<--hostname>
|
|
||||||
|
|
||||||
IP Addr/FQDN of the webserver host (required)
|
|
||||||
|
|
||||||
=item B<--port>
|
|
||||||
|
|
||||||
Port used by Apache
|
|
||||||
|
|
||||||
=item B<--proto>
|
|
||||||
|
|
||||||
Specify https if needed
|
|
||||||
|
|
||||||
=item B<--proxyurl>
|
|
||||||
|
|
||||||
Proxy URL if any
|
|
||||||
|
|
||||||
=item B<--kayako-api-url>
|
|
||||||
|
|
||||||
This is the URL you should dispatch all GET, POST, PUT & DELETE requests to.
|
|
||||||
|
|
||||||
=item B<--kayako-api-key>
|
|
||||||
|
|
||||||
This is your unique API key.
|
|
||||||
|
|
||||||
=item B<--kayako-secret-key>
|
|
||||||
|
|
||||||
The secret key is used to sign all the requests dispatched to Kayako.
|
|
||||||
|
|
||||||
=back
|
|
||||||
|
|
||||||
=cut
|
|
@ -1,68 +0,0 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Stéphane Duret <sduret@merethis.com>
|
|
||||||
#
|
|
||||||
####################################################################################
|
|
||||||
|
|
||||||
package apps::kayako::plugin;
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use base qw(centreon::plugins::script_simple);
|
|
||||||
|
|
||||||
sub new {
|
|
||||||
my ($class, %options) = @_;
|
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
|
||||||
bless $self, $class;
|
|
||||||
# $options->{options} = options object
|
|
||||||
|
|
||||||
$self->{version} = '0.1';
|
|
||||||
%{$self->{modes}} = (
|
|
||||||
'list-department' => 'apps::kayako::mode::listdepartment',
|
|
||||||
'list-priority' => 'apps::kayako::mode::listpriority',
|
|
||||||
'list-staff' => 'apps::kayako::mode::liststaff',
|
|
||||||
'list-status' => 'apps::kayako::mode::liststatus',
|
|
||||||
'ticket-count' => 'apps::kayako::mode::ticketcount',
|
|
||||||
);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
|
||||||
|
|
||||||
__END__
|
|
||||||
|
|
||||||
=head1 PLUGIN DESCRIPTION
|
|
||||||
|
|
||||||
Check Selenium server.
|
|
||||||
|
|
||||||
=cut
|
|
69
centreon-plugins/apps/kayako/sql/mode/listdepartment.pm
Normal file
69
centreon-plugins/apps/kayako/sql/mode/listdepartment.pm
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package apps::kayako::sql::mode::listdepartment;
|
||||||
|
|
||||||
|
use base qw(centreon::plugins::mode);
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
sub new {
|
||||||
|
my ($class, %options) = @_;
|
||||||
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
|
bless $self, $class;
|
||||||
|
$self->{version} = '1.0';
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub check_options {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
$self->SUPER::init(%options);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub run {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
$self->{sql} = $options{sql};
|
||||||
|
|
||||||
|
$self->{sql}->connect();
|
||||||
|
|
||||||
|
$self->{sql}->query(query => "SELECT departmentid, title FROM swdepartments");
|
||||||
|
while ((my $row = $self->{sql}->fetchrow_hashref())) {
|
||||||
|
$self->{output}->output_add(long_msg => "'" . $row->{title} . "' [id = " . $row->{departmentid} . "]");
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{output}->output_add(severity => 'OK',
|
||||||
|
short_msg => 'List departments:');
|
||||||
|
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
|
||||||
|
$self->{output}->exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 MODE
|
||||||
|
|
||||||
|
List departments of kayako
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=cut
|
69
centreon-plugins/apps/kayako/sql/mode/listpriority.pm
Normal file
69
centreon-plugins/apps/kayako/sql/mode/listpriority.pm
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package apps::kayako::sql::mode::listpriority;
|
||||||
|
|
||||||
|
use base qw(centreon::plugins::mode);
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
sub new {
|
||||||
|
my ($class, %options) = @_;
|
||||||
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
|
bless $self, $class;
|
||||||
|
$self->{version} = '1.0';
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub check_options {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
$self->SUPER::init(%options);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub run {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
$self->{sql} = $options{sql};
|
||||||
|
|
||||||
|
$self->{sql}->connect();
|
||||||
|
|
||||||
|
$self->{sql}->query(query => "SELECT priorityid, title FROM swticketpriorities");
|
||||||
|
while ((my $row = $self->{sql}->fetchrow_hashref())) {
|
||||||
|
$self->{output}->output_add(long_msg => "'" . $row->{title} . "' [id = " . $row->{priorityid} . "]");
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{output}->output_add(severity => 'OK',
|
||||||
|
short_msg => 'List priorities:');
|
||||||
|
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
|
||||||
|
$self->{output}->exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 MODE
|
||||||
|
|
||||||
|
List priorities of kayako
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=cut
|
69
centreon-plugins/apps/kayako/sql/mode/liststaff.pm
Normal file
69
centreon-plugins/apps/kayako/sql/mode/liststaff.pm
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package apps::kayako::sql::mode::liststaff;
|
||||||
|
|
||||||
|
use base qw(centreon::plugins::mode);
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
sub new {
|
||||||
|
my ($class, %options) = @_;
|
||||||
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
|
bless $self, $class;
|
||||||
|
$self->{version} = '1.0';
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub check_options {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
$self->SUPER::init(%options);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub run {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
$self->{sql} = $options{sql};
|
||||||
|
|
||||||
|
$self->{sql}->connect();
|
||||||
|
|
||||||
|
$self->{sql}->query(query => "SELECT staffid, username FROM swstaff");
|
||||||
|
while ((my $row = $self->{sql}->fetchrow_hashref())) {
|
||||||
|
$self->{output}->output_add(long_msg => "'" . $row->{username} . "' [id = " . $row->{staffid} . "]");
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{output}->output_add(severity => 'OK',
|
||||||
|
short_msg => 'List staff:');
|
||||||
|
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
|
||||||
|
$self->{output}->exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 MODE
|
||||||
|
|
||||||
|
List staff of kayako
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=cut
|
69
centreon-plugins/apps/kayako/sql/mode/liststatus.pm
Normal file
69
centreon-plugins/apps/kayako/sql/mode/liststatus.pm
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package apps::kayako::sql::mode::liststatus;
|
||||||
|
|
||||||
|
use base qw(centreon::plugins::mode);
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
sub new {
|
||||||
|
my ($class, %options) = @_;
|
||||||
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
|
bless $self, $class;
|
||||||
|
$self->{version} = '1.0';
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub check_options {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
$self->SUPER::init(%options);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub run {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
$self->{sql} = $options{sql};
|
||||||
|
|
||||||
|
$self->{sql}->connect();
|
||||||
|
|
||||||
|
$self->{sql}->query(query => "SELECT ticketstatusid, title FROM swticketstatus");
|
||||||
|
while ((my $row = $self->{sql}->fetchrow_hashref())) {
|
||||||
|
$self->{output}->output_add(long_msg => "'" . $row->{title} . "' [id = " . $row->{ticketstatusid} . "]");
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{output}->output_add(severity => 'OK',
|
||||||
|
short_msg => 'List status:');
|
||||||
|
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
|
||||||
|
$self->{output}->exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 MODE
|
||||||
|
|
||||||
|
List status of kayako
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=cut
|
273
centreon-plugins/apps/kayako/sql/mode/ticketcount.pm
Normal file
273
centreon-plugins/apps/kayako/sql/mode/ticketcount.pm
Normal file
@ -0,0 +1,273 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package apps::kayako::sql::mode::ticketcount;
|
||||||
|
|
||||||
|
use base qw(centreon::plugins::mode);
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use centreon::plugins::statefile;
|
||||||
|
use Time::Local;
|
||||||
|
|
||||||
|
my $ticket_total = 0;
|
||||||
|
my %tickets;
|
||||||
|
my $label;
|
||||||
|
my $start = "";
|
||||||
|
my $end = "";
|
||||||
|
my $priority_filter;
|
||||||
|
my @priority_filters;
|
||||||
|
|
||||||
|
sub new {
|
||||||
|
my ($class, %options) = @_;
|
||||||
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
|
bless $self, $class;
|
||||||
|
|
||||||
|
$self->{version} = '1.0';
|
||||||
|
$options{options}->add_options(arguments =>
|
||||||
|
{
|
||||||
|
"reload-cache-time:s" => { name => 'reload_cache_time', default => 180 },
|
||||||
|
"department-id:s" => { name => 'department_id' },
|
||||||
|
"staff-id:s" => { name => 'staff_id' },
|
||||||
|
"status-id:s" => { name => 'status_id' },
|
||||||
|
"priority-id:s" => { name => 'priority_id' },
|
||||||
|
"warning:s" => { name => 'warning' },
|
||||||
|
"critical:s" => { name => 'critical' },
|
||||||
|
"start-date:s" => { name => 'start_date' },
|
||||||
|
"end-date:s" => { name => 'end_date' },
|
||||||
|
});
|
||||||
|
$self->{statefile_cache} = centreon::plugins::statefile->new(%options);
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub check_options {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
|
if (defined($self->{option_results}->{start_date})) {
|
||||||
|
if ($self->{option_results}->{start_date} !~ m/^\d{1,2}-\d{1,2}-\d{4}$/){
|
||||||
|
$self->{output}->add_option_msg(short_msg => "Please specify a valid date (DD-MM-YYYY).");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
} else {
|
||||||
|
my ($mday,$mon,$year) = split(/-/, $self->{option_results}->{'start_date'});
|
||||||
|
$start = $self->{option_results}->{start_date};
|
||||||
|
$self->{option_results}->{start_date} = timelocal(0,0,0,$mday,$mon-1,$year);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (defined($self->{option_results}->{end_date})) {
|
||||||
|
if ($self->{option_results}->{end_date} !~ m/^\d{1,2}-\d{1,2}-\d{4}$/){
|
||||||
|
$self->{output}->add_option_msg(short_msg => "Please specify a valid date (DD-MM-YYYY).");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
} else {
|
||||||
|
my ($mday,$mon,$year) = split(/-/, $self->{option_results}->{end_date});
|
||||||
|
$end = $self->{option_results}->{end_date};
|
||||||
|
$self->{option_results}->{end_date} = timelocal(59,59,23,$mday,$mon-1,$year);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
if (defined($self->{option_results}->{priority_id})) {
|
||||||
|
@priority_filters = split(/,/, $self->{option_results}->{priority_id});
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{statefile_cache}->check_options(%options);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub reload_cache {
|
||||||
|
my ($self) = @_;
|
||||||
|
my $datas = {};
|
||||||
|
|
||||||
|
$datas->{last_timestamp} = time();
|
||||||
|
|
||||||
|
$self->{sql}->query(query => "SELECT departmentid, title FROM swdepartments");
|
||||||
|
while ((my $row = $self->{sql}->fetchrow_hashref())) {
|
||||||
|
$datas->{"department_" . $row->{departmentid}} = $self->{output}->to_utf8($row->{title});
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{sql}->query(query => "SELECT priorityid, title FROM swticketpriorities");
|
||||||
|
while ((my $row = $self->{sql}->fetchrow_hashref())) {
|
||||||
|
$datas->{"priority_" . $row->{priorityid}} = $self->{output}->to_utf8($row->{title});
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{sql}->query(query => "SELECT staffid, username FROM swstaff");
|
||||||
|
while ((my $row = $self->{sql}->fetchrow_hashref())) {
|
||||||
|
$datas->{"staff_" . $row->{staffid}} = $self->{output}->to_utf8($row->{username});
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{sql}->query(query => "SELECT ticketstatusid, title FROM swticketstatus");
|
||||||
|
while ((my $row = $self->{sql}->fetchrow_hashref())) {
|
||||||
|
$datas->{"status_" . $row->{ticketstatusid}} = $self->{output}->to_utf8($row->{title});
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{statefile_cache}->write(data => $datas);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub run {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
$self->{sql} = $options{sql};
|
||||||
|
|
||||||
|
$self->{sql}->connect();
|
||||||
|
|
||||||
|
my $has_cache_file = $self->{statefile_cache}->read(statefile => 'cache_sql_' . $self->{sql}->get_unique_id4save() . '_kayako');
|
||||||
|
my $timestamp_cache = $self->{statefile_cache}->get(name => 'last_timestamp');
|
||||||
|
if ($has_cache_file == 0 ||
|
||||||
|
!defined($timestamp_cache) || ((time() - $timestamp_cache) > (($self->{option_results}->{reload_cache_time}) * 60))) {
|
||||||
|
$self->reload_cache();
|
||||||
|
$self->{statefile_cache}->read();
|
||||||
|
}
|
||||||
|
|
||||||
|
my $query = "SELECT priorityid FROM swtickets WHERE ticketid IS NOT NULL";
|
||||||
|
if (defined($self->{option_results}->{'department_id'})) {
|
||||||
|
$query .= " AND departmentid IN (" . $self->{option_results}->{'department_id'} . ")";
|
||||||
|
}
|
||||||
|
if (defined($self->{option_results}->{'priority_id'})) {
|
||||||
|
$query .= " AND priorityid IN (" . $self->{option_results}->{'priority_id'} . ")";
|
||||||
|
}
|
||||||
|
if (defined($self->{option_results}->{'staff_id'})) {
|
||||||
|
$query .= " AND ownerstaffid IN (" . $self->{option_results}->{'staff_id'} . ")";
|
||||||
|
}
|
||||||
|
if (defined($self->{option_results}->{'status_id'})) {
|
||||||
|
$query .= " AND ticketstatusid IN (" . $self->{option_results}->{'status_id'} . ")";
|
||||||
|
}
|
||||||
|
if (defined($self->{option_results}->{'start_date'})) {
|
||||||
|
$query .= " AND lastactivity > " . $self->{option_results}->{'start_date'};
|
||||||
|
}
|
||||||
|
if (defined($self->{option_results}->{'end_date'})) {
|
||||||
|
$query .= " AND lastactivity < " . $self->{option_results}->{'end_date'};
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{sql}->query(query => $query);
|
||||||
|
|
||||||
|
while ((my $row = $self->{sql}->fetchrow_hashref())) {
|
||||||
|
if (defined($self->{option_results}->{priority_id})) {
|
||||||
|
foreach $priority_filter (@priority_filters) {
|
||||||
|
if ($priority_filter == $row->{priorityid}) {
|
||||||
|
$tickets{$priority_filter}++;
|
||||||
|
$ticket_total++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$ticket_total++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
###########
|
||||||
|
# Manage Output
|
||||||
|
###########
|
||||||
|
my $exit = $self->{perfdata}->threshold_check(value => $ticket_total, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
||||||
|
my $staff = "";
|
||||||
|
my $ticket_status = "";
|
||||||
|
my $period = "";
|
||||||
|
|
||||||
|
if (defined($self->{option_results}->{staff_id}) && ($self->{option_results}->{staff_id} =~ m/^\d*$/)) {
|
||||||
|
$staff = " for staff '" . $self->{statefile_cache}->get(name => 'staff_'.$self->{option_results}->{'staff_id'}) ."'";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defined($self->{option_results}->{status_id}) && ($self->{option_results}->{status_id} =~ m/^\d*$/)) {
|
||||||
|
$ticket_status = " in status '" . $self->{statefile_cache}->get(name => 'status_'.$self->{option_results}->{'status_id'}) ."'";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defined($self->{option_results}->{start_date}) || defined($self->{option_results}->{end_date})){
|
||||||
|
$period = " -";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defined($self->{option_results}->{start_date})){
|
||||||
|
$start = " Start: " . $start;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defined($self->{option_results}->{end_date})){
|
||||||
|
$end = " End: " . $end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defined($self->{option_results}->{priority_id})) {
|
||||||
|
foreach $priority_filter (@priority_filters) {
|
||||||
|
$label = $self->{statefile_cache}->get(name => 'priority_' . $priority_filter);
|
||||||
|
$self->{output}->perfdata_add(label => $label, value => $tickets{$priority_filter},
|
||||||
|
min => 0, max => $ticket_total);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$self->{output}->perfdata_add(label => 'Total', value => $ticket_total,
|
||||||
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
||||||
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
|
||||||
|
min => 0);
|
||||||
|
|
||||||
|
$self->{output}->output_add(severity => $exit,
|
||||||
|
short_msg => sprintf("%s tickets%s%s%s%s%s", $ticket_total, $staff, $ticket_status, $period, $start, $end));
|
||||||
|
|
||||||
|
$self->{output}->display();
|
||||||
|
$self->{output}->exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 MODE
|
||||||
|
|
||||||
|
Count tickets of kayako
|
||||||
|
|
||||||
|
=over 8
|
||||||
|
|
||||||
|
=item B<--department-id>
|
||||||
|
|
||||||
|
Filter the tickets by the specified department id, you can specify multiple id's by separating the values using a comma. Example: 1,2,3 .
|
||||||
|
You must define at least one id. (required)
|
||||||
|
|
||||||
|
=item B<--priority-id>
|
||||||
|
|
||||||
|
Filter the tickets by the specified ticket priority id, you can specify multiple id's by separating the values using a comma. Example: 1,2,3 .
|
||||||
|
By default, all ticket priority are included.
|
||||||
|
|
||||||
|
=item B<--staff-id>
|
||||||
|
|
||||||
|
Filter the tickets by the specified owner staff id, you can specify multiple id's by separating the values using a comma. Example: 1,2,3 .
|
||||||
|
By default, all staff users are included.
|
||||||
|
|
||||||
|
=item B<--status-id>
|
||||||
|
|
||||||
|
Filter the tickets by the specified ticket status id, you can specify multiple id's by separating the values using a comma. Example: 1,2,3 .
|
||||||
|
By default, the filter is on unresolved ticket statuses.
|
||||||
|
|
||||||
|
=item B<--warning>
|
||||||
|
|
||||||
|
Threshold warning.
|
||||||
|
|
||||||
|
=item B<--critical>
|
||||||
|
|
||||||
|
Threshold critical.
|
||||||
|
|
||||||
|
=item B<--start-date>
|
||||||
|
|
||||||
|
Filter on last activity. For example: 21-03-2014
|
||||||
|
|
||||||
|
=item B<--end-date>
|
||||||
|
|
||||||
|
Filter on last activity. For example: 21-03-2014
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=cut
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::lmsensors::mode::fan;
|
package apps::lmsensors::mode::fan;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::lmsensors::mode::misc;
|
package apps::lmsensors::mode::misc;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::lmsensors::mode::temperature;
|
package apps::lmsensors::mode::temperature;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::lmsensors::mode::voltage;
|
package apps::lmsensors::mode::voltage;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
###############################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Florian Asche <info@florian-asche.de>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::lmsensors::plugin;
|
package apps::lmsensors::plugin;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Simon Bomm <sbomm@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::lotus::snmp::mode::mailstate;
|
package apps::lotus::snmp::mode::mailstate;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Simon Bomm <sbomm@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::lotus::snmp::mode::mailtime;
|
package apps::lotus::snmp::mode::mailtime;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Simon Bomm <sbomm@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::lotus::snmp::mode::serveravailability;
|
package apps::lotus::snmp::mode::serveravailability;
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
################################################################################
|
|
||||||
# Copyright 2005-2013 MERETHIS
|
|
||||||
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
|
|
||||||
# GPL Licence 2.0.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with
|
|
||||||
# this program; if not, see <http://www.gnu.org/licenses>.
|
|
||||||
#
|
|
||||||
# Linking this program statically or dynamically with other modules is making a
|
|
||||||
# combined work based on this program. Thus, the terms and conditions of the GNU
|
|
||||||
# General Public License cover the whole combination.
|
|
||||||
#
|
|
||||||
# As a special exception, the copyright holders of this program give MERETHIS
|
|
||||||
# permission to link this program with independent modules to produce an executable,
|
|
||||||
# regardless of the license terms of these independent modules, and to copy and
|
|
||||||
# distribute the resulting executable under terms of MERETHIS choice, provided that
|
|
||||||
# MERETHIS also meet, for each linked independent module, the terms and conditions
|
|
||||||
# of the license of that module. An independent module is a module which is not
|
|
||||||
# derived from this program. If you modify this program, you may extend this
|
|
||||||
# exception to your version of the program, but you are not obliged to do so. If you
|
|
||||||
# do not wish to do so, delete this exception statement from your version.
|
|
||||||
#
|
|
||||||
# For more information : contact@centreon.com
|
|
||||||
# Authors : Simon Bomm <sbomm@merethis.com>
|
|
||||||
#
|
#
|
||||||
####################################################################################
|
# Copyright 2015 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
package apps::lotus::snmp::mode::servertransactions;
|
package apps::lotus::snmp::mode::servertransactions;
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user