mirror of
https://github.com/opnsense/plugins.git
synced 2026-05-28 04:34:15 -04:00
*/*: merge @fraenki plugin modifications minus title removal
This commit is contained in:
parent
d570503b80
commit
6abffda11b
8 changed files with 30 additions and 19 deletions
|
|
@ -1,6 +1,5 @@
|
|||
PLUGIN_NAME= zabbix-agent
|
||||
PLUGIN_VERSION= 1.1
|
||||
PLUGIN_REVISION= 1
|
||||
PLUGIN_VERSION= 1.2
|
||||
PLUGIN_COMMENT= Enterprise-class open source distributed monitoring agent
|
||||
PLUGIN_DEPENDS= zabbix34-agent
|
||||
PLUGIN_MAINTAINER= opnsense@moov.de
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ function zabbixagent_services()
|
|||
}
|
||||
|
||||
$services[] = array(
|
||||
'description' => gettext('Enterprise-class open source distributed monitoring agent'),
|
||||
'description' => gettext('Zabbix Agent'),
|
||||
'pidfile' => '/var/run/zabbix/zabbix_agentd.pid',
|
||||
'configd' => array(
|
||||
'restart' => array('zabbix_agentd restart'),
|
||||
|
|
|
|||
|
|
@ -46,8 +46,10 @@ class ServiceController extends ApiControllerBase
|
|||
public function startAction()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
// close session for long running action
|
||||
$this->sessionClose();
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdRun("zabbixagent start", true);
|
||||
$response = $backend->configdRun("zabbixagent start");
|
||||
return array("response" => $response);
|
||||
} else {
|
||||
return array("response" => array());
|
||||
|
|
@ -61,6 +63,8 @@ class ServiceController extends ApiControllerBase
|
|||
public function stopAction()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
// close session for long running action
|
||||
$this->sessionClose();
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdRun("zabbixagent stop");
|
||||
return array("response" => $response);
|
||||
|
|
@ -76,6 +80,8 @@ class ServiceController extends ApiControllerBase
|
|||
public function restartAction()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
// close session for long running action
|
||||
$this->sessionClose();
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdRun("zabbixagent restart");
|
||||
return array("response" => $response);
|
||||
|
|
|
|||
|
|
@ -71,12 +71,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
draggable: true
|
||||
});
|
||||
} else {
|
||||
// request service status after successful save and update status box (wait a few seconds before update)
|
||||
setTimeout(function(){
|
||||
ajaxCall(url="/api/zabbixagent/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
},3000);
|
||||
ajaxCall(url="/api/zabbixagent/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ type:script
|
|||
message:restarting zabbix_agentd
|
||||
|
||||
[status]
|
||||
command:/usr/local/etc/rc.d/zabbix_agentd status
|
||||
command:/usr/local/etc/rc.d/zabbix_agentd status; exit 0
|
||||
parameters:
|
||||
type:script_output
|
||||
message:requesting zabbix_agentd status
|
||||
|
|
|
|||
|
|
@ -46,8 +46,10 @@ class ServiceController extends ApiControllerBase
|
|||
public function startAction()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
// close session for long running action
|
||||
$this->sessionClose();
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdRun("haproxy start", true);
|
||||
$response = $backend->configdRun("haproxy start");
|
||||
return array("response" => $response);
|
||||
} else {
|
||||
return array("response" => array());
|
||||
|
|
@ -61,6 +63,8 @@ class ServiceController extends ApiControllerBase
|
|||
public function stopAction()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
// close session for long running action
|
||||
$this->sessionClose();
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdRun("haproxy stop");
|
||||
return array("response" => $response);
|
||||
|
|
@ -76,6 +80,8 @@ class ServiceController extends ApiControllerBase
|
|||
public function restartAction()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
// close session for long running action
|
||||
$this->sessionClose();
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdRun("haproxy restart");
|
||||
return array("response" => $response);
|
||||
|
|
|
|||
|
|
@ -352,12 +352,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
draggable: true
|
||||
});
|
||||
} else {
|
||||
// request service status after successful save and update status box (wait a few seconds before update)
|
||||
setTimeout(function(){
|
||||
ajaxCall(url="/api/haproxy/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
},3000);
|
||||
ajaxCall(url="/api/haproxy/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -48,8 +48,10 @@ class ServiceController extends ApiControllerBase
|
|||
public function startAction()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
// close session for long running action
|
||||
$this->sessionClose();
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdRun("acmeclient http-start", true);
|
||||
$response = $backend->configdRun("acmeclient http-start");
|
||||
return array("response" => $response);
|
||||
} else {
|
||||
return array("response" => array());
|
||||
|
|
@ -63,6 +65,8 @@ class ServiceController extends ApiControllerBase
|
|||
public function stopAction()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
// close session for long running action
|
||||
$this->sessionClose();
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdRun("acmeclient http-stop");
|
||||
return array("response" => $response);
|
||||
|
|
@ -78,6 +82,8 @@ class ServiceController extends ApiControllerBase
|
|||
public function restartAction()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
// close session for long running action
|
||||
$this->sessionClose();
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdRun("acmeclient http-restart");
|
||||
return array("response" => $response);
|
||||
|
|
|
|||
Loading…
Reference in a new issue