Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nagios check component

This library lets you run Nagios checks and parse the output from your PHP application.

Example:

$nagioschecker = new \Devophp\Component\Nagios\Checker();
$nagioschecker->autoDetectPluginPath();

$response = $nagioschecker->check('users', '-w 3 -c 5');

echo "Statuscode: " . $response->getStatusCode() . ' (' . $response->getStatusText() . ')' . "\n";
echo "ServiceOutput: " . $response->getServiceOutput() . "\n";
echo "ServicePerfData: " . $response->getServicePerfData() . "\n";

Included console tool

This library comes with a simple command line tool that you can use to run tests through this library.

Some example commands:

bin/console nagios:check users --arguments="-w 3 -c 5"

This will output:

Running check 'users' with arguments: '-w 3 -c 5'
Pluginpath: /usr/local/Cellar/nagios-plugins/2.0/sbin/
Statuscode: 0 (OK)
ServiceOutput: USERS OK - 2 users currently logged in
ServicePerfData: users=2;3;5;0

About

Execute nagios checks and parse the output with PHP classes

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages