src/MonitoringLivestatus.php
public function createUNIXSocketConnection($title, $path, $active = true) {
        $result = $this->api->request(
            'monitoring.livestatus.create',
            [
                'data' => [
                    'connection' => 'unix',
                    'title' => $title,
                    'path' => $path,
                    'active' => $active
                ]
            ]
        );

        if (!array_key_exists('id', $result) ||
            !is_numeric($result['id']) ||
            !array_key_exists('success', $result) ||
            $result['success'] !== true) {
            if (array_key_exists('message', $result)) {
                throw new RuntimeException(sprintf('Bad result: %s', $result['message']));
            } else {
                throw new RuntimeException('Bad result');
            }
        }

        return (int) $result['id'];
    }
public function createUNIXSocketConnection($title, $path, $active = true) {
        $result = $this->api->request(
            'monitoring.livestatus.create',
            [
                'data' => [
                    'connection' => 'unix',
                    'title' => $title,
                    'path' => $path,
                    'active' => $active
                ]
            ]
        );

        if (!array_key_exists('id', $result) ||
            !is_numeric($result['id']) ||
            !array_key_exists('success', $result) ||
            $result['success'] !== true) {
            if (array_key_exists('message', $result)) {
                throw new RuntimeException(sprintf('Bad result: %s', $result['message']));
            } else {
                throw new RuntimeException('Bad result');
            }
        }

        return (int) $result['id'];
    }
public function createUNIXSocketConnection ( $ title , $ path , $ active = true ) { $ result = $ this -> api -> request ( 'monitoring.livestatus.create' , [ 'data' => [ 'connection' => 'unix' , 'title' => $ title , 'path' => $ path , 'active' => $ active ] ] ) ; if ( ! array_key_exists ( 'id' , $ result ) || ! is_numeric ( $ result [ 'id' ] ) || ! array_key_exists ( 'success' , $ result ) || $ result [ 'success' ] !== true ) { if ( array_key_exists ( 'message' , $ result ) ) { throw new RuntimeException ( sprintf ( 'Bad result: %s' , $ result [ 'message' ] ) ) ; } else { throw new RuntimeException ( 'Bad result' ) ; } } return ( int ) $ result [ 'id' ] ; }
Add a new monitoring instance listening on a UNIX socket

@param string $title Title
@param string $path Path to UNIX socket
@param bool $active Enable this instance? Defaults to true

@return int Identifier

@throws Exception on error
Add a new monitoring instance listening on a UNIX socket