Skip to content
This repository has been archived by the owner on Oct 25, 2021. It is now read-only.

Latest commit

 

History

History
executable file
·
36 lines (28 loc) · 1.11 KB

README.md

File metadata and controls

executable file
·
36 lines (28 loc) · 1.11 KB

NSCA

Build Status on TravisCI XP Framework Module BSD Licence Requires PHP 7.0+ Latest Stable Version

NSCA (Nagios Service Check Acceptor) Client

Example

use org\nagios\nsca\{NscaClient, NscaMessage, NscaProtocol};

$c= new NscaClient('nagios.example.com');
$c->connect();

$c->send(new NscaMessage(
  'ws.example.com', 
  'queue_check', 
  NscaProtocol::OK,
  'Up and running'
));
$c->send(new NscaMessage(
  'ws.example.com', 
  'queue_check', 
  NscaProtocol::ERROR,
  'No answer on port 80 after 2 seconds'
));

$c->close();