+ +
+ +
+
diff --git a/net-mgmt/xymon-client/LICENSE b/net-mgmt/xymon-client/LICENSE new file mode 100644 index 0000000000..05e44609c7 --- /dev/null +++ b/net-mgmt/xymon-client/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Kumy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/net-mgmt/xymon-client/Makefile b/net-mgmt/xymon-client/Makefile new file mode 100644 index 0000000000..10576a5e6c --- /dev/null +++ b/net-mgmt/xymon-client/Makefile @@ -0,0 +1,8 @@ +PLUGIN_NAME= xymon-client +PLUGIN_VERSION= 1.0.0 +PLUGIN_REVISION= 1 +PLUGIN_DEPENDS= xymon-client +PLUGIN_COMMENT= Client for the Xymon network monitor +PLUGIN_MAINTAINER= github+opnsense-xymon-client@kumy.net + +.include "../../Mk/plugins.mk" diff --git a/net-mgmt/xymon-client/pkg-descr b/net-mgmt/xymon-client/pkg-descr new file mode 100644 index 0000000000..b903f655e1 --- /dev/null +++ b/net-mgmt/xymon-client/pkg-descr @@ -0,0 +1,13 @@ +Client data collection package for Xymon (previously known as Hobbit). + +This gathers statistics and data from a single system and reports it to +the Xymon monitor. + +WWW: https://sourceforge.net/projects/xymon/ + +Plugin Changelog +================ + +1.0.0 + +* Initial release diff --git a/net-mgmt/xymon-client/src/etc/inc/plugins.inc.d/xymonclient.inc b/net-mgmt/xymon-client/src/etc/inc/plugins.inc.d/xymonclient.inc new file mode 100644 index 0000000000..d095d3b54e --- /dev/null +++ b/net-mgmt/xymon-client/src/etc/inc/plugins.inc.d/xymonclient.inc @@ -0,0 +1,69 @@ +enabled == '1'; +} + +function xymonclient_services() +{ + global $config; + + $services = []; + + $fqdn = sprintf('%s.%s', + $config['system']['hostname'], + $config['system']['domain'], + ); + + if (xymonclient_enabled()) { + $services[] = [ + 'description' => gettext('Xymon client'), + 'configd' => [ + 'restart' => ['xymonclient restart'], + 'start' => ['xymonclient start'], + 'stop' => ['xymonclient stop'], + ], + 'name' => 'xymonclient', + 'pidfile' => "/var/run/xymon/xymon_client.pid" + ]; + } + + return $services; +} + +function xymonclient_xmlrpc_sync() +{ + $result = []; + + $result[] = [ + 'description' => gettext('Xymon client'), + 'section' => 'kumy.xymon.client', + 'id' => 'xymonclient', + 'services' => ['xymonclient'], + ]; + + return $result; +} diff --git a/net-mgmt/xymon-client/src/opnsense/mvc/app/controllers/Kumy/XymonClient/Api/ServiceController.php b/net-mgmt/xymon-client/src/opnsense/mvc/app/controllers/Kumy/XymonClient/Api/ServiceController.php new file mode 100644 index 0000000000..1586d290c9 --- /dev/null +++ b/net-mgmt/xymon-client/src/opnsense/mvc/app/controllers/Kumy/XymonClient/Api/ServiceController.php @@ -0,0 +1,35 @@ +request->isPost()) { + $backend = new Backend(); + $status = strtolower(trim($backend->configdRun('template reload Kumy/XymonClient'))); + if ($status === 'ok') { + $config = $this->getModel(); + if ((string)$config->enabled == "1" && !empty((string)$config->XYMSERVERS)) { + $status = $backend->configdRun('xymonclient restart'); + } else { + $status = $backend->configdRun('xymonclient stop'); + } + } + } + return ['status' => strtolower(trim($status))]; + } +} diff --git a/net-mgmt/xymon-client/src/opnsense/mvc/app/controllers/Kumy/XymonClient/IndexController.php b/net-mgmt/xymon-client/src/opnsense/mvc/app/controllers/Kumy/XymonClient/IndexController.php new file mode 100644 index 0000000000..5c5274ab56 --- /dev/null +++ b/net-mgmt/xymon-client/src/opnsense/mvc/app/controllers/Kumy/XymonClient/IndexController.php @@ -0,0 +1,34 @@ +view->formSettings = $this->getForm('settings'); + $this->view->pick('Kumy/XymonClient/index'); + } +} diff --git a/net-mgmt/xymon-client/src/opnsense/mvc/app/controllers/Kumy/XymonClient/forms/settings.xml b/net-mgmt/xymon-client/src/opnsense/mvc/app/controllers/Kumy/XymonClient/forms/settings.xml new file mode 100644 index 0000000000..f7f0b96410 --- /dev/null +++ b/net-mgmt/xymon-client/src/opnsense/mvc/app/controllers/Kumy/XymonClient/forms/settings.xml @@ -0,0 +1,16 @@ +
diff --git a/net-mgmt/xymon-client/src/opnsense/mvc/app/models/Kumy/XymonClient/Menu/Menu.xml b/net-mgmt/xymon-client/src/opnsense/mvc/app/models/Kumy/XymonClient/Menu/Menu.xml new file mode 100644 index 0000000000..0fffdf082b --- /dev/null +++ b/net-mgmt/xymon-client/src/opnsense/mvc/app/models/Kumy/XymonClient/Menu/Menu.xml @@ -0,0 +1,5 @@ + diff --git a/net-mgmt/xymon-client/src/opnsense/mvc/app/models/Kumy/XymonClient/Settings.php b/net-mgmt/xymon-client/src/opnsense/mvc/app/models/Kumy/XymonClient/Settings.php new file mode 100644 index 0000000000..f3fb72613c --- /dev/null +++ b/net-mgmt/xymon-client/src/opnsense/mvc/app/models/Kumy/XymonClient/Settings.php @@ -0,0 +1,30 @@ + +