Subversion Repositories oidplus

Rev

Rev 1407 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1407 Rev 1416
Line 1... Line 1...
1
<?php /* <ViaThinkSoftSignature>
1
<?php /* <ViaThinkSoftSignature>
2
BEVRboq5hkwbOT0Gkx96NQV+AryItRRkSW10PEkTSbC55Oe8geeNWyFnN0b2BZmYw
2
oaCDAKN7XIqonGgZV3naE1MsJxh3TFaZyTKTdLYx8hr38k4cg/z79ACGiN0STlaW+
3
Dbrw/pEuTs1J8Dyu0yEzZBu0JtxVRdgOtJJSMM9PM/FV+holxrFR8UALRJBL3Masp
3
LIDKKalDDRBbOk3Obk/Ld2TVSyEpu91BL1BD1RCotns/cqfqCW+4L5tLxGfRvb/qf
4
Dp/yCpP+R/X0osOMz+rKW+T3RfnwM4hQ+QyFlXy9wEYFhxUBVeoJZFvcFGGnWR8DT
4
2s68MrVY4FdhFDfMX8j4XKnwcGCAKp8QQuiwZwHNiGnHzbfTU0dXIAn1LXMjqBQ9T
5
bQqKGdD+VIfQlX9FO0r93Z2xJVfGMZ+QSzh0+8yCGPJqI6yAS4YWjnygH+AxYuA/t
5
cfkT7rqiQ2uG7PTgWWkKWuw5+06WO5vyF+aPtXRNGVJjz93FwBzR3QFl2PLzMHEcc
6
R4hUG2bfbsQiEa2Ix8GlmvfCQ5mWhVgYkzSom1nAorhDnTZrXXhHbaMPIeMXyBxky
6
M38HFs25OYrBSBHS1HzPxt7gDE7hLZYZzSHxfodZq9dwCqqmsEx5aVkDx3tY6flWR
7
bT6JGZV2VjWg6UqDZTPMlqAJ+QAQ+W9rJBCwtBIGUzokqYtAf+cW0+GRQSgz7G8NU
7
I8jTlQmQUj8EEFv1UJzp043LIt0+jRdWqisVXBjmqzhB0i7ipr/LJezcTphodnhN3
8
hnKqzbsrn+ogfDA4PRP8P6IZI4qY9XcsMm6Kxw3Aw9wQ6qtkQwhu2ixrLUPjIYN4Y
8
eaRhZc4Hq3DblBTuui6GAL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es5sarBU31FLmM40mmnzNWhrDF7f0+hH5VOK2Jge2keq2DlBpIlOx
17
9r70N4t9tnSS08CUQwxZlBUq2pPZqYyJXYRrLuuJcsuZNaun0pLcncp2aKOB6MBPd
17
zkXs8XjzJEE09O0TMqN+zOHupJRV73d7y5RTnnQFJ+NRZdeXo3AwBWlNkUQIGDJZb
18
Y6GgQt4QBZloPZFmF+Uw6AXs6KhiOc44VPzJLm+cwjKWYo+CIR112hBieVTRGDCPH
18
bTjwv6utl1djL2HYgownc/aEJo4pWUuXoNRCRwxCKfYOPTAzLh7YvLMQ6aeMJUmYG
19
51+e5dJVhqV0ZyOR7E4B4IPa6lq6Up2Ei5+8xK3Mi1lH7iGBydx8AoQ4w0Nn95w5o
19
X6X1rqMrFXlCECcXFH8UKD3ToCmLDEv9GmkkBvRu0wJuKr2ecqFt5qMKyXH+DMqxz
20
nk6SLdi5k7713yxkqjZ3zsfYGJwQrSE2dAjnoDFeIQtJjClx2119Q3eflOYj5Ihke
20
xAcmtc4EfTDRgpQoPqzfWHvF7dBTt1UD2mC2YKuTcsU3H4huzU3L3DlPFdo/kWxGw
21
ZkdRgRWLKod00NIy3rLCJQdSt7AFTXJwRPJzh15vuLGELAPC2mW6Rn+fqRY+pKmd6
21
P9qHSDMANNVXkPPm9OL+MUq0f42uaVBZY7ylpvvnJyQYTj9Uk/tbsFqIQYUcESoO/
22
8oQEQw46/GHOyTyMHfJKqIfxlVOVlwAdKoWjTnQ8JtP4aBD3LQkfmZ89Uw7lujBir
22
UHE2JPHs7GI7ByjsYdnIDRGmvREGbPrGCMx0VSQtN54Cc+FjWdClfZWEXznOOZRV9
23
w==
23
Q==
24
</ViaThinkSoftSignature> */ ?>
24
</ViaThinkSoftSignature> */ ?>
25
<?php
25
<?php
26
 
26
 
27
/*
27
/*
28
 
28
 
Line 276... Line 276...
276
        We will intentionally NOT follow the following guidelines:
276
        We will intentionally NOT follow the following guidelines:
277
        - https://nagios-plugins.org/doc/guidelines.html#AEN256 (Don't be tricked into following symlinks)
277
        - https://nagios-plugins.org/doc/guidelines.html#AEN256 (Don't be tricked into following symlinks)
278
          Reason: We believe that this guideline is contraproductive.
278
          Reason: We believe that this guideline is contraproductive.
279
                  Nagios plugins usually run as user 'nagios'. It is the task of the system administrator
279
                  Nagios plugins usually run as user 'nagios'. It is the task of the system administrator
280
                  to ensure that the user 'nagios' must not read/write to files which are not intended
280
                  to ensure that the user 'nagios' must not read/write to files which are not intended
281
                  for access by the Nagios service. Instead, symlinks are useful for several tasks.
281
                  for access by the Nagios service. Symlinks, on the other hand, are useful for several tasks.
282
                  See also http://stackoverflow.com/questions/27112949/nagios-plugins-why-not-following-symlinks
282
                  See also https://stackoverflow.com/questions/27112949/nagios-plugins-why-not-following-symlinks
283
 
283
 
284
VNag over HTTP:
284
VNag over HTTP:
285
 
285
 
286
        A script that uses the VNag framework can run as CLI script (normal Nagios plugin) or as web site (or both).
286
        A script that uses the VNag framework can run as CLI script (normal Nagios plugin) or as web site (or both).
287
        Having the script run as website, you can include a Nagios information combined with a human friendly HTML output which can
287
        Having the script run as website, you can include a Nagios information combined with a human friendly HTML output which can
Line 345... Line 345...
345
        // Returns true for '' or null. Does not return true for value 0 or '0' (like empty() does)
345
        // Returns true for '' or null. Does not return true for value 0 or '0' (like empty() does)
346
        return is_null($x) || (trim($x) == '');
346
        return is_null($x) || (trim($x) == '');
347
}
347
}
348
 
348
 
349
abstract class VNag {
349
abstract class VNag {
350
        /*public*/ const VNAG_VERSION = '2022-12-18';
350
        /*public*/ const VNAG_VERSION = '2023-09-11';
351
 
351
 
352
        // Status 0..3 for STATUSMODEL_SERVICE (the default status model):
352
        // Status 0..3 for STATUSMODEL_SERVICE (the default status model):
353
        # 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."
353
        # 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."
354
        # We choose 4 as exitcode. The plugin developer is free to return any other status.
354
        # We choose 4 as exitcode. The plugin developer is free to return any other status.
355
        /*public*/ const STATUS_OK       = 0;
355
        /*public*/ const STATUS_OK       = 0;