Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zabbix
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
certo
zabbix
Commits
f4e7254f
Commit
f4e7254f
authored
Nov 20, 2019
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separated Server and ServerActive agent settings
parent
a1145919
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
Makefile
Makefile
+1
-0
zabbix_agent
zabbix_agent
+15
-0
zabbix_agentd-configure
zabbix_agentd-configure
+6
-1
No files found.
Makefile
View file @
f4e7254f
...
...
@@ -52,6 +52,7 @@ define ZABBIX_AGENT_CONFIG
config
zabbix
'agent'
option
server
''
option
serveractive
''
endef
export
ZABBIX_AGENT_CONFIG
...
...
zabbix_agent
View file @
f4e7254f
...
...
@@ -17,6 +17,7 @@ entry_execute_method_root_Zabbix() {
common_execute_method_obj
"
$DMROOT
.Zabbix."
"0"
common_execute_method_obj
"
$DMROOT
.Zabbix.Agent."
"0"
common_execute_method_param
"
$DMROOT
.Zabbix.Agent.Server"
"1"
"zabbix_get_agent_server"
"zabbix_set_agent_server"
common_execute_method_param
"
$DMROOT
.Zabbix.Agent.ServerActive"
"1"
"zabbix_get_agent_serveractive"
"zabbix_set_agent_serveractive"
return
0
;
;;
esac
...
...
@@ -39,3 +40,17 @@ zabbix_set_agent_server() {
chmod
a+r /etc/config/zabbix
fi
}
zabbix_get_agent_serveractive
()
{
echo
`
$UCI_GET
zabbix.agent.serveractive
`
}
zabbix_set_agent_serveractive
()
{
local
serveractive
=
`
$UCI_GET
zabbix.agent.serveractive
`
if
[
"
$serveractive
"
!=
"
$1
"
]
;
then
$UCI_SET
zabbix.agent.serveractive
=
"
$1
"
$UCI_COMMIT
chmod
a+r /etc/config/zabbix
fi
}
zabbix_agentd-configure
View file @
f4e7254f
#!/bin/sh
SERVER
=
`
/sbin/uci
-q
get zabbix.agent.server
`
SERVERACTIVE
=
`
/sbin/uci
-q
get zabbix.agent.serveractive
`
if
[
!
-z
"
$SERVER
"
]
;
then
echo
"Server=
$SERVER
"
>
/etc/zabbix_agentd.conf.d/zabbix_agent.conf
echo
"ServerActive=
$SERVER
"
>>
/etc/zabbix_agentd.conf.d/zabbix_agent.conf
else
exit
1
fi
if
[
!
-z
"
$SERVERACTIVE
"
]
;
then
echo
"ServerActive=
$SERVERACTIVE
"
>>
/etc/zabbix_agentd.conf.d/zabbix_agent.conf
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment