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
781fba50
Commit
781fba50
authored
Apr 09, 2019
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Zabbix server related configs
parent
da43e0f7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
124 additions
and
2 deletions
+124
-2
Makefile
Makefile
+2
-2
zabbix.conf.php
zabbix.conf.php
+19
-0
zabbix_agent
zabbix_agent
+0
-0
zabbix_server
zabbix_server
+84
-0
zabbix_server-configure
zabbix_server-configure
+19
-0
No files found.
Makefile
View file @
781fba50
...
...
@@ -24,7 +24,7 @@ agent: zabbix-agent-service zabbix-agent-config
@
echo
"
$$
ZABBIX_AGENT_SERVICE"
>
/lib/systemd/system/zabbix-agent.service
systemctl
enable
zabbix-agent.service
@
echo
"
$$
ZABBIX_AGENT_CONFIG"
>>
/etc/config/zabbix
install
-v
-Dm755
zabbix
/usr/share/easycwmp/functions
install
-v
-Dm755
zabbix
_agent /usr/share/easycwmp/functions/zabbix
rm
-rf
zabbix-3.4.14
zabbix-agent-service
:
...
...
@@ -89,7 +89,7 @@ server: zabbix-server-service zabbix-server-config httpd-conf
@
echo
"
$$
ZABBIX_SERVER_SERVICE"
>
/lib/systemd/system/zabbix-server.service
systemctl
enable
zabbix-server.service
@
echo
"
$$
ZABBIX_SERVER_CONFIG"
>>
/etc/config/zabbix
install
-v
-Dm755
zabbix
/usr/share/easycwmp/functions
install
-v
-Dm755
zabbix
_server /usr/share/easycwmp/functions/zabbix
echo
"Defaults !requiretty"
>>
/etc/sudoers
echo
"ALL ALL=(ALL) NOPASSWD: /usr/bin/nmap"
>>
/etc/sudoers
rm
-rf
zabbix-3.4.14
...
...
zabbix.conf.php
0 → 100644
View file @
781fba50
<?php
// Zabbix GUI configuration file.
global
$DB
;
$DB
[
'TYPE'
]
=
'MYSQL'
;
$DB
[
'SERVER'
]
=
trim
(
`/sbin/uci -q get mysql.credentials.hostname`
);
$DB
[
'PORT'
]
=
'3306'
;
$DB
[
'DATABASE'
]
=
trim
(
`/sbin/uci -q get mysql.credentials.database`
);
$DB
[
'USER'
]
=
trim
(
`/sbin/uci -q get mysql.credentials.username`
);
$DB
[
'PASSWORD'
]
=
trim
(
`/sbin/uci -q get mysql.credentials.password`
);
// Schema name. Used for IBM DB2 and PostgreSQL.
$DB
[
'SCHEMA'
]
=
''
;
$ZBX_SERVER
=
trim
(
`/sbin/uci -q get zabbix.server.hostname`
);
$ZBX_SERVER_PORT
=
"10051"
;
$ZBX_SERVER_NAME
=
trim
(
`/sbin/uci -q get zabbix.server.name`
);
$IMAGE_FORMAT_DEFAULT
=
IMAGE_FORMAT_PNG
;
zabbix
→
zabbix
_agent
View file @
781fba50
File moved
zabbix_server
0 → 100755
View file @
781fba50
#!/bin/sh
#common_execute_method_param "$parameter" "$permission" "$get_cmd" "$set_cmd" "xsd:$type" "$forcedinform"
# $forcedinform should be set to 1 if the parameter is included in the inform message otherwise empty
# Default of $type = string
#############################
# Entry point functuons #
#############################
prefix_list
=
"
$prefix_list
$DMROOT
.Zabbix."
entry_execute_method_list
=
"
$entry_execute_method_list
entry_execute_method_root_Zabbix"
entry_execute_method_list_forcedinform
=
"
$entry_execute_method_list_forcedinform
entry_execute_method_root_Zabbix"
entry_execute_method_root_Zabbix
()
{
case
"
$1
"
in
""
|
"
$DMROOT
."
|
"
$DMROOT
.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_obj
"
$DMROOT
.Zabbix.Server."
"0"
common_execute_method_param
"
$DMROOT
.Zabbix.Server.Server"
"1"
"zabbix_get_server_server"
"zabbix_set_server_server"
common_execute_method_param
"
$DMROOT
.Zabbix.Server.Name"
"1"
"zabbix_get_server_name"
"zabbix_set_server_name"
common_execute_method_param
"
$DMROOT
.Zabbix.Server.StartPollers"
"1"
"zabbix_get_start_pollers"
"zabbix_set_start_pollers"
return
0
;
;;
esac
return
$E_INVALID_PARAMETER_NAME
;
}
#######################################
# Data model parameters functions #
#######################################
zabbix_get_agent_server
()
{
echo
`
$UCI_GET
zabbix.agent.server
`
}
zabbix_set_agent_server
()
{
local
server
=
`
$UCI_GET
zabbix.agent.server
`
if
[
"
$server
"
!=
"
$1
"
]
;
then
$UCI_SET
zabbix.agent.server
=
"
$1
"
$UCI_COMMIT
chmod
a+r /etc/config/zabbix
fi
}
zabbix_get_server_server
()
{
echo
`
$UCI_GET
zabbix.server.hostname
`
}
zabbix_set_server_server
()
{
local hostname
=
`
$UCI_GET
zabbix.server.hostname
`
if
[
"
$hostname
"
!=
"
$1
"
]
;
then
$UCI_SET
zabbix.server.hostname
=
"
$1
"
$UCI_COMMIT
chmod
a+r /etc/config/zabbix
fi
}
zabbix_get_server_name
()
{
echo
`
$UCI_GET
zabbix.server.name
`
}
zabbix_set_server_name
()
{
local
name
=
`
$UCI_GET
zabbix.server.name
`
if
[
"
$name
"
!=
"
$1
"
]
;
then
$UCI_SET
zabbix.server.name
=
"
$1
"
$UCI_COMMIT
chmod
a+r /etc/config/zabbix
fi
}
zabbix_get_start_pollers
()
{
echo
`
$UCI_GET
zabbix.server.startpollers
`
}
zabbix_set_start_pollers
()
{
local
startpollers
=
`
$UCI_GET
zabbix.server.startpollers
`
if
[
"
$startpollers
"
!=
"
$1
"
]
;
then
$UCI_SET
zabbix.server.startpollers
=
"
$1
"
$UCI_COMMIT
chmod
a+r /etc/config/zabbix
fi
}
zabbix_server-configure
0 → 100644
View file @
781fba50
#!/bin/sh
SERVER
=
`
/sbin/uci
-q
get mysql.credentials.hostname
`
DATABASE
=
`
/sbin/uci
-q
get mysql.credentials.database
`
USER
=
`
/sbin/uci
-q
get mysql.credentials.username
`
PASSWORD
=
`
/sbin/uci
-q
get mysql.credentials.password
`
START_POLLERS
=
`
/sbin/uci
-q
get zabbix.server.startpollers
`
if
[
!
-z
"
$SERVER
"
]
&&
[
!
-z
"
$DATABASE
"
]
&&
[
!
-z
"
$USER
"
]
&&
[
!
-z
"
$PASSWORD
"
]
;
then
echo
"DBHost=
$SERVER
"
>
/etc/zabbix_server.conf.d/zabbix_server.conf
echo
"DBName=
$DATABASE
"
>>
/etc/zabbix_server.conf.d/zabbix_server.conf
echo
"DBUser=
$USER
"
>>
/etc/zabbix_server.conf.d/zabbix_server.conf
echo
"DBPassword=
$PASSWORD
"
>>
/etc/zabbix_server.conf.d/zabbix_server.conf
if
[
!
-z
"
$START_POLLERS
"
]
;
then
echo
"StartPollers=
$START_POLLERS
"
>>
/etc/zabbix_server.conf.d/zabbix_server.conf
fi
else
exit
1
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