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ahrK7RDdspt9tJb7ILZwJBADBwApse |
r8zgXM1RmkuNWxYX1sV7aZLRIWcaJveD/xmucbTdqaYr+W/g6SYws56NHef/hCcHv |
U2alFmLKvBMmfBrb1LRGPx/BZE2WYfoDOLpaRVl1e2xwUOcePm7vltxksTe5rthtf |
mP3JHM7l8SACuH+xdrOQ2Nx6ah3XQ4XVNvb12wMAHij4ArVhFdVizVZSGdcKxt1iV |
jyVlrU7TrmbyMGRyNM3u13iGRFxCihGgV6pSejNGu+G5OWdlfr828mHqn2ZECAbc+ |
wH7wVt3ukrY8uvLeCnoC7H8ylPCl7LeFxqZ3PFBHEJflcVkfjnDS5NnJ/JlaBHPA5 |
9Ue1EgmqVmHzP+u73pEEWMyqOOAULu52N+X6JWXqSB3dLF+HnoijilSRWAobYCYzN |
H98+mVik8K5I4KW1GdCdexOpMd7cTLKQ8NJCagZzJ5HpX2XBCemlDKoQac1o8lN9P |
EG3ORkajdosJ1wvhInrmBXYwPFbQKst/yA5amjgjX67ptW75fIkZS+zdoUf9cbKrK |
uestRJn83HuMT34ruDmo4FaV4E9kPiSC2GlQ6GFwcrU9dIy2JdRjFNl+6Ywf0LL40 |
pglnOhBlEciPIv5VnSWhqe1jxPfIWzmKoZv8wCelXai3BclNBo6gZR3T6majsJcMx |
A== |
</ViaThinkSoftSignature> */ ?> |
<?php |
|
/* |
|
VNag - Nagios Framework for PHP (C) 2014-2020 |
VNag - Nagios Framework for PHP (C) 2014-2021 |
__ ___ _____ _ _ _ ____ __ _ |
\ \ / (_) __ |_ _| |__ (_)_ __ | | __/ ___| ___ / _| |_ |
\ \ / /| |/ _` || | | '_ \| | '_ \| |/ /\___ \ / _ \| |_| __| |
35,7 → 35,7 |
|
Developed by Daniel Marschall www.viathinksoft.com |
Licensed under the terms of the Apache 2.0 license |
Revision 2020-12-06 |
Revision 2021-03-21 |
|
*/ |
|
222,7 → 222,16 |
you can encrypt the machine-readable part of your HTTP output by |
setting $this->password_out . If you want to read the information, |
you need to set $this->password_in at the web-reader plugin. |
The visual output is not encrypted. So, if you want to hide the information, |
then you must not enable visual HTML output. |
|
Attention! |
- An empty string is also considered as password. If you don't want to encrypt the |
machine-readable output, please set $this->password_out to null. |
- Encryption and decryption require the OpenSSL extension in PHP. |
|
Digital signature: |
|
You can sign the output by setting $this->privkey with a filename containing |
a private key created by OpenSSL. If it is encrypted, please also set |
$this->privkey_password . |
230,9 → 239,7 |
the filename of the public key file. |
|
Attention! |
- An empty string is also considered as password. If you don't want to encrypt the |
machine-readable output, please set $this->password_out to null. |
- Both features (encryption and signatures) require the OpenSSL plugin in PHP. |
- Signatures require the OpenSSL extension in PHP. |
|
Performance data: |
|
340,7 → 347,7 |
} |
|
abstract class VNag { |
/*public*/ const VNAG_VERSION = '2020-04-21'; |
/*public*/ const VNAG_VERSION = '2021-03-21'; |
|
// Status 0..3 for STATUSMODEL_SERVICE (the default status model): |
# The guideline states: "Higher-level errors (such as name resolution errors, socket timeouts, etc) are outside of the control of plugins and should generally NOT be reported as UNKNOWN states." |
1046,6 → 1053,9 |
} |
|
if (!is_null($this->pubkey)) { |
if (substr($this->pubkey,0,3) === '---') { |
$public_key = $this->pubkey; |
} else { |
if (!file_exists($this->pubkey)) { |
throw new VNagInvalidArgumentException(sprintf(VNagLang::$pubkey_file_not_found, $this->pubkey)); |
} |
1054,6 → 1064,7 |
if (!$public_key) { |
throw new VNagPublicKeyException(sprintf(VNagLang::$pubkey_file_not_readable, $this->pubkey)); |
} |
} |
|
if (!isset($dataset['signature'])) { |
throw new VNagSignatureException(VNagLang::$signature_missing); |
1130,6 → 1141,12 |
throw new VNagException(VNagLang::$openssl_missing); |
} |
|
if (substr($this->privkey,0,3) === '---') { |
$pkeyid = @openssl_pkey_get_private($this->privkey, $this->privkey_password); |
if (!$pkeyid) { |
throw new VNagPrivateKeyException(sprintf(VNagLang::$privkey_not_readable)); |
} |
} else { |
if (!file_exists($this->privkey)) { |
throw new VNagInvalidArgumentException(sprintf(VNagLang::$privkey_file_not_found, $this->privkey)); |
} |
1137,12 → 1154,16 |
if (!$pkeyid) { |
throw new VNagPrivateKeyException(sprintf(VNagLang::$privkey_file_not_readable, $this->privkey)); |
} |
} |
|
$signature = ''; |
if (@openssl_sign($payload, $signature, $pkeyid, $this->sign_algo)) { |
$sign_algo = is_null($this->sign_algo) ? OPENSSL_ALGO_SHA256 : $this->sign_algo; |
if (@openssl_sign($payload, $signature, $pkeyid, $sign_algo)) { |
openssl_free_key($pkeyid); |
|
$dataset['signature'] = base64_encode($signature); |
} else { |
throw new VNagPrivateKeyException(sprintf(VNagLang::$signature_failed)); |
} |
} |
|
2460,7 → 2481,9 |
static $pubkey_file_not_found = "Public key file %s was not found."; |
static $pubkey_file_not_readable = "Public key file %s is not readable."; |
static $privkey_file_not_found = "Private key file %s was not found."; |
static $privkey_not_readable = "Private key is not readable."; |
static $privkey_file_not_readable = "Private key file %s is not readable."; |
static $signature_failed = "Signature failed."; |
static $perfdata_line_invalid = "Performance data line %s is invalid."; |
static $singlevalue_unexpected_at_symbol = 'This plugin does not allow the @-symbol at ranges for single values.'; |
static $illegalSingleValueBehavior = "Illegal value for 'singleValueBehavior'. Please contact the creator of the plugin."; |