コード例 #1
0
 /**
  * Sends a heartbeat to nagios
  *
  * @param   int status status of service (one of NSCA_OK, NSCA_WARN, NSCA_ERROR, NSCA_UNKNOWN)
  * @param   string message default ''
  * @throws  io.IOException in case
  */
 public function send($status, $message = '')
 {
     $nsca = new NscaClient($this->server, $this->port, $this->version, NSCA_CRYPT_XOR);
     $nsca->connect();
     $nsca->send(new NscaMessage($this->host, $this->service, $status, $message));
     $nsca->close();
 }