mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 19:05:13 +08:00
✨ Sync 2026-08-25 19:47:18
This commit is contained in:
1 parent
f88d417520
commit
b93641d613
29 files changed
+57
-804
No files matched your search
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall
|
||||
PKG_VERSION:=26.8.19
|
||||
PKG_RELEASE:=242
|
||||
PKG_RELEASE:=243
|
||||
PKG_PO_VERSION:=$(PKG_VERSION)
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
|
||||
@@ -1268,11 +1268,18 @@ function gen_config(var)
|
||||
end
|
||||
|
||||
function get_node_by_id(node_id)
|
||||
if not node_id or node_id == "" or node_id == "nil" then return nil end
|
||||
local section = api.uci_get_c(node_id) or {}
|
||||
local section
|
||||
if type(node_id) == "table" then
|
||||
section = node_id
|
||||
elseif type(node_id) == "string" then
|
||||
if node_id == "" or node_id == "nil" then return nil end
|
||||
section = api.uci_get_c(node_id) or {}
|
||||
else
|
||||
return nil
|
||||
end
|
||||
if section[".type"] == "socks" then
|
||||
local result = {
|
||||
[".name"] = node_id,
|
||||
return {
|
||||
[".name"] = section[".name"],
|
||||
remarks = "socks[%s]" % section.port,
|
||||
type = "sing-box",
|
||||
protocol = "socks",
|
||||
@@ -1280,7 +1287,6 @@ function gen_config(var)
|
||||
port = section.port,
|
||||
uot = "1"
|
||||
}
|
||||
return result
|
||||
end
|
||||
if section[".type"] == "nodes" then
|
||||
return section
|
||||
@@ -1447,12 +1453,7 @@ function gen_config(var)
|
||||
|
||||
function gen_outbound_get_tag(flag, node_id, tag, proxy_table)
|
||||
if not node_id or node_id == "nil" then return nil end
|
||||
local node
|
||||
if type(node_id) == "string" then
|
||||
node = get_node_by_id(node_id)
|
||||
elseif type(node_id) == "table" then
|
||||
node = node_id
|
||||
end
|
||||
local node = get_node_by_id(node_id)
|
||||
if not tag then tag = node[".name"] end
|
||||
if node then
|
||||
if proxy_table.chain_proxy == "1" or proxy_table.chain_proxy == "2" then
|
||||
|
||||
@@ -1010,11 +1010,18 @@ function gen_config(var)
|
||||
|
||||
|
||||
function get_node_by_id(node_id)
|
||||
if not node_id or node_id == "" or node_id == "nil" then return nil end
|
||||
local section = api.uci_get_c(node_id) or {}
|
||||
local section
|
||||
if type(node_id) == "table" then
|
||||
section = node_id
|
||||
elseif type(node_id) == "string" then
|
||||
if node_id == "" or node_id == "nil" then return nil end
|
||||
section = api.uci_get_c(node_id) or {}
|
||||
else
|
||||
return nil
|
||||
end
|
||||
if section[".type"] == "socks" then
|
||||
local result = {
|
||||
[".name"] = node_id,
|
||||
return {
|
||||
[".name"] = section[".name"],
|
||||
remarks = "socks[%s]" % section.port,
|
||||
type = "Xray",
|
||||
protocol = "socks",
|
||||
@@ -1023,7 +1030,6 @@ function gen_config(var)
|
||||
transport = "tcp",
|
||||
stream_security = "none"
|
||||
}
|
||||
return result
|
||||
end
|
||||
if section[".type"] == "nodes" then
|
||||
return section
|
||||
@@ -1272,12 +1278,7 @@ function gen_config(var)
|
||||
|
||||
function gen_outbound_get_tag(flag, node_id, tag, proxy_table)
|
||||
if not node_id or node_id == "" or node_id == "nil" then return nil end
|
||||
local node
|
||||
if type(node_id) == "string" then
|
||||
node = get_node_by_id(node_id)
|
||||
elseif type(node_id) == "table" then
|
||||
node = node_id
|
||||
end
|
||||
local node = get_node_by_id(node_id)
|
||||
if not tag then tag = node[".name"] end
|
||||
if node then
|
||||
if proxy_table.chain_proxy == "1" or proxy_table.chain_proxy == "2" then
|
||||
|
||||
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall2
|
||||
PKG_VERSION:=26.8.20
|
||||
PKG_RELEASE:=100
|
||||
PKG_RELEASE:=101
|
||||
PKG_PO_VERSION:=$(PKG_VERSION)
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
|
||||
@@ -1311,11 +1311,18 @@ function gen_config(var)
|
||||
end
|
||||
|
||||
function get_node_by_id(node_id)
|
||||
if not node_id or node_id == "" or node_id == "nil" then return nil end
|
||||
local section = api.uci_get_c(node_id) or {}
|
||||
local section
|
||||
if type(node_id) == "table" then
|
||||
section = node_id
|
||||
elseif type(node_id) == "string" then
|
||||
if node_id == "" or node_id == "nil" then return nil end
|
||||
section = api.uci_get_c(node_id) or {}
|
||||
else
|
||||
return nil
|
||||
end
|
||||
if section[".type"] == "socks" then
|
||||
local result = {
|
||||
[".name"] = node_id,
|
||||
return {
|
||||
[".name"] = section[".name"],
|
||||
remarks = "socks[%s]" % section.port,
|
||||
type = "sing-box",
|
||||
protocol = "socks",
|
||||
@@ -1323,7 +1330,6 @@ function gen_config(var)
|
||||
port = section.port,
|
||||
uot = "1"
|
||||
}
|
||||
return result
|
||||
end
|
||||
if section[".type"] == "nodes" then
|
||||
return section
|
||||
@@ -1487,12 +1493,7 @@ function gen_config(var)
|
||||
|
||||
function gen_outbound_get_tag(flag, node_id, tag, proxy_table)
|
||||
if not node_id or node_id == "nil" then return nil end
|
||||
local node
|
||||
if type(node_id) == "string" then
|
||||
node = get_node_by_id(node_id)
|
||||
elseif type(node_id) == "table" then
|
||||
node = node_id
|
||||
end
|
||||
local node = get_node_by_id(node_id)
|
||||
if not tag then tag = node[".name"] end
|
||||
if node then
|
||||
if proxy_table.chain_proxy == "1" or proxy_table.chain_proxy == "2" then
|
||||
|
||||
@@ -1010,11 +1010,18 @@ function gen_config(var)
|
||||
end
|
||||
|
||||
function get_node_by_id(node_id)
|
||||
if not node_id or node_id == "" or node_id == "nil" then return nil end
|
||||
local section = api.uci_get_c(node_id) or {}
|
||||
local section
|
||||
if type(node_id) == "table" then
|
||||
section = node_id
|
||||
elseif type(node_id) == "string" then
|
||||
if node_id == "" or node_id == "nil" then return nil end
|
||||
section = api.uci_get_c(node_id) or {}
|
||||
else
|
||||
return nil
|
||||
end
|
||||
if section[".type"] == "socks" then
|
||||
local result = {
|
||||
[".name"] = node_id,
|
||||
return {
|
||||
[".name"] = section[".name"],
|
||||
remarks = "socks[%s]" % section.port,
|
||||
type = "Xray",
|
||||
protocol = "socks",
|
||||
@@ -1023,7 +1030,6 @@ function gen_config(var)
|
||||
transport = "tcp",
|
||||
stream_security = "none"
|
||||
}
|
||||
return result
|
||||
end
|
||||
if section[".type"] == "nodes" then
|
||||
return section
|
||||
@@ -1269,12 +1275,7 @@ function gen_config(var)
|
||||
|
||||
function gen_outbound_get_tag(flag, node_id, tag, proxy_table)
|
||||
if not node_id or node_id == "" or node_id == "nil" then return nil end
|
||||
local node
|
||||
if type(node_id) == "string" then
|
||||
node = get_node_by_id(node_id)
|
||||
elseif type(node_id) == "table" then
|
||||
node = node_id
|
||||
end
|
||||
local node = get_node_by_id(node_id)
|
||||
if not tag then tag = node[".name"] end
|
||||
if node then
|
||||
if proxy_table.chain_proxy == "1" or proxy_table.chain_proxy == "2" then
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-wwand
|
||||
PKG_RELEASE:=4
|
||||
PKG_RELEASE:=5
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/ddimension/luci-app-wwand.git
|
||||
PKG_SOURCE_VERSION:=7f0c58f56cc060bd3355fed7fd86a68ad7003e9e
|
||||
PKG_SOURCE_DATE:=2026-08-24
|
||||
PKG_SOURCE_VERSION:=ae57d82431f6c65e6afa27267bfb71c8bea39bff
|
||||
PKG_SOURCE_DATE:=2026-08-25
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-zabbix
|
||||
|
||||
LUCI_TITLE:=zabbix agentd configuration
|
||||
LUCI_DEPENDS:=+luci-base
|
||||
LUCI_DEPENDS:=zabbix-agentd-ssl
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@@ -1,81 +0,0 @@
|
||||
'use strict';
|
||||
'require form';
|
||||
'require view';
|
||||
'require uci';
|
||||
'require ui';
|
||||
'require fs';
|
||||
|
||||
return view.extend({
|
||||
render: function() {
|
||||
|
||||
var m, s, o;
|
||||
|
||||
m = new form.Map('zabbix', _('Zabbix Agent configuration'));
|
||||
|
||||
s = m.section(form.TypedSection, 'zabbix');
|
||||
s.anonymous = true;
|
||||
s.addremove = false;
|
||||
s.tab('general', _('General Settings'));
|
||||
s.tab('passive', _('Passive Checks'));
|
||||
s.tab('active', _('Active Checks'));
|
||||
s.tab('tls', _('TLS Configuration'));
|
||||
|
||||
o = s.taboption('general', form.Flag, 'enabled', _('Enabled'));
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.taboption('general', form.Value, 'hostname', _('Hostname'), _('Unique hostname used by the agent to register with the Zabbix server. Required for active checks and must match the node name specified on the server.'));
|
||||
o.rmempty = false;
|
||||
o.datatype = 'host';
|
||||
o.cfgvalue = function(section_id) {
|
||||
return uci.get('zabbix', section_id, 'hostname') || fs.trimmed('/proc/sys/kernel/hostname')
|
||||
};
|
||||
|
||||
o = s.taboption('passive', form.DynamicList, 'server', _('Server'), _('List of IP addresses (or hostnames) of Zabbix servers allowed to connect to this agent. If 0.0.0.0/0 is specified, the agent will accept connections from any IP address.'));
|
||||
o.rmempty = false;
|
||||
o.datatype = 'or(cidr,ipmask,host)';
|
||||
|
||||
o = s.taboption('passive', form.Value, 'listen_ip', _('ListenIP'), _('IP address of the local network interfaces on which the Zabbix agent will listen for incoming connections from the server.'));
|
||||
o.datatype = 'host';
|
||||
|
||||
o = s.taboption('passive', form.Value, 'listen_port', _('ListenPort'), _('The agent will listen on this port for connections from the server.'));
|
||||
o.placeholder = 10050;
|
||||
o.datatype = 'range(1024,32767)';
|
||||
|
||||
o = s.taboption('passive', form.ListValue, 'tls_accept', _('TLSAccept'), _('The parameter defines which types of TLS connections the agent will accept.'));
|
||||
o.default = 'unencrypted';
|
||||
o.value('unencrypted',_('without encryption'));
|
||||
o.value('psk',_('pre-shared key'));
|
||||
o.value('cert',_('certificate'));
|
||||
|
||||
o = s.taboption('active', form.Value, 'server_active', _('ServerActive'), _('IP address or hostname of the Zabbix server for active checks. If the parameter is not specified, active checks are disabled.'));
|
||||
o.datatype = 'or(cidr,host,hostport,ipaddrport)';
|
||||
|
||||
o = s.taboption('active', form.ListValue, 'tls_connect', _('TLSConnect'), _('The parameter defines how the agent should establish a secure connection with the Zabbix server or proxy.'));
|
||||
o.default = 'unencrypted';
|
||||
o.value('unencrypted',_('without encryption'));
|
||||
o.value('psk',_('pre-shared key'));
|
||||
o.value('cert',_('certificate'));
|
||||
|
||||
o = s.taboption('tls', form.Value, 'tls_psk_identity', _('TLSPSKIdentity'), _('Pre-shared key identifier string. Used for unique identification and management of the pre-shared key, ensuring the security of the connection between the agent and the server.'));
|
||||
o.depends({tls_accept: 'psk'});
|
||||
o.depends({tls_connect: 'psk'});
|
||||
|
||||
o = s.taboption('tls', form.FileUpload, 'tls_psk_file', _('TLSPSKFile'), _('Agent pre-shared key.'));
|
||||
o.depends({tls_accept: 'psk'});
|
||||
o.depends({tls_connect: 'psk'});
|
||||
|
||||
o = s.taboption('tls', form.FileUpload, 'tls_ca_file', _('TLSCAFile'), _('Root CA certificate. Used for encrypted connections between Zabbix components.'));
|
||||
o.depends({tls_accept: 'cert'});
|
||||
o.depends({tls_connect: 'cert'});
|
||||
|
||||
o = s.taboption('tls', form.FileUpload, 'tls_cert_file', _('TLSCertFile'), _('Agent certificate or certificate chain used to establish secure (TLS/SSL) connections between Zabbix components.'));
|
||||
o.depends({tls_accept: 'cert'});
|
||||
o.depends({tls_connect: 'cert'});
|
||||
|
||||
o = s.taboption('tls', form.FileUpload, 'tls_key_file', _('TLSKeyFile'), _('Agent private key.'));
|
||||
o.depends({tls_accept: 'cert'});
|
||||
o.depends({tls_connect: 'cert'});
|
||||
|
||||
return m.render();
|
||||
}
|
||||
});
|
||||
@@ -1,95 +0,0 @@
|
||||
msgid "Zabbix Agent configuration"
|
||||
msgstr "Zabbix Agent configuration"
|
||||
|
||||
msgid "General Settings"
|
||||
msgstr "General Settings"
|
||||
|
||||
msgid "Passive Checks"
|
||||
msgstr "Passive Checks"
|
||||
|
||||
msgid "Active Checks"
|
||||
msgstr "Active Checks"
|
||||
|
||||
msgid "TLS Configuration"
|
||||
msgstr "TLS Configuration"
|
||||
|
||||
msgid "Enabled"
|
||||
msgstr "Enabled"
|
||||
|
||||
msgid "Hostname"
|
||||
msgstr "Hostname"
|
||||
|
||||
msgid "Unique hostname used by the agent to register with the Zabbix server. Required for active checks and must match the node name specified on the server."
|
||||
msgstr "Unique hostname used by the agent to register with the Zabbix server. Required for active checks and must match the node name specified on the server."
|
||||
|
||||
msgid "Server"
|
||||
msgstr "Server"
|
||||
|
||||
msgid "List of IP addresses (or hostnames) of Zabbix servers allowed to connect to this agent. If 0.0.0.0/0 is specified, the agent will accept connections from any IP address."
|
||||
msgstr "List of IP addresses (or hostnames) of Zabbix servers allowed to connect to this agent. If 0.0.0.0/0 is specified, the agent will accept connections from any IP address."
|
||||
|
||||
msgid "IP address of the local network interfaces on which the Zabbix agent will listen for incoming connections from the server."
|
||||
msgstr "IP address of the local network interfaces on which the Zabbix agent will listen for incoming connections from the server."
|
||||
|
||||
msgid "ListenPort"
|
||||
msgstr "ListenPort"
|
||||
|
||||
msgid "The agent will listen on this port for connections from the server."
|
||||
msgstr "The agent will listen on this port for connections from the server."
|
||||
|
||||
msgid "TLSAccept"
|
||||
msgstr "TLSAccept"
|
||||
|
||||
msgid "The parameter defines which types of TLS connections the agent will accept."
|
||||
msgstr "The parameter defines which types of TLS connections the agent will accept."
|
||||
|
||||
msgid "without encryption"
|
||||
msgstr "without encryption"
|
||||
|
||||
msgid "pre-shared key"
|
||||
msgstr "pre-shared key"
|
||||
|
||||
msgid "certificate"
|
||||
msgstr "certificate"
|
||||
|
||||
msgid "ServerActive"
|
||||
msgstr "ServerActive"
|
||||
|
||||
msgid "IP address or hostname of the Zabbix server for active checks. If the parameter is not specified, active checks are disabled."
|
||||
msgstr "IP address or hostname of the Zabbix server for active checks. If the parameter is not specified, active checks are disabled."
|
||||
|
||||
msgid "TLSConnect"
|
||||
msgstr "TLSConnect"
|
||||
|
||||
msgid "The parameter defines how the agent should establish a secure connection with the Zabbix server or proxy."
|
||||
msgstr "The parameter defines how the agent should establish a secure connection with the Zabbix server or proxy."
|
||||
|
||||
msgid "TLSPSKIdentity"
|
||||
msgstr "TLSPSKIdentity"
|
||||
|
||||
msgid "Pre-shared key identifier string. Used for unique identification and management of the pre-shared key, ensuring the security of the connection between the agent and the server."
|
||||
msgstr "Pre-shared key identifier string. Used for unique identification and management of the pre-shared key, ensuring the security of the connection between the agent and the server."
|
||||
|
||||
msgid "TLSPSKFile"
|
||||
msgstr "TLSPSKFile"
|
||||
|
||||
msgid "Agent pre-shared key."
|
||||
msgstr "Agent pre-shared key."
|
||||
|
||||
msgid "TLSCAFile"
|
||||
msgstr "TLSCAFile"
|
||||
|
||||
msgid "Root CA certificate. Used for encrypted connections between Zabbix components."
|
||||
msgstr "Root CA certificate. Used for encrypted connections between Zabbix components."
|
||||
|
||||
msgid "TLSCertFile"
|
||||
msgstr "TLSCertFile"
|
||||
|
||||
msgid "Agent certificate or certificate chain used to establish secure (TLS/SSL) connections between Zabbix components."
|
||||
msgstr "Agent certificate or certificate chain used to establish secure (TLS/SSL) connections between Zabbix components."
|
||||
|
||||
msgid "TLSKeyFile"
|
||||
msgstr "TLSKeyFile"
|
||||
|
||||
msgid "Agent private key."
|
||||
msgstr "Agent private key."
|
||||
@@ -1,95 +0,0 @@
|
||||
msgid "Zabbix Agent configuration"
|
||||
msgstr "Настройки Zabbix Agent"
|
||||
|
||||
msgid "General Settings"
|
||||
msgstr "Основные настройки"
|
||||
|
||||
msgid "Passive Checks"
|
||||
msgstr "Пассивные проверки"
|
||||
|
||||
msgid "Active Checks"
|
||||
msgstr "Активные проверки"
|
||||
|
||||
msgid "TLS Configuration"
|
||||
msgstr "TLS шифрование"
|
||||
|
||||
msgid "Enabled"
|
||||
msgstr "Включить"
|
||||
|
||||
msgid "Hostname"
|
||||
msgstr "Hostname"
|
||||
|
||||
msgid "Unique hostname used by the agent to register with the Zabbix server. Required for active checks and must match the node name specified on the server."
|
||||
msgstr "Уникальное имя хоста, используемое агентом для регистрации на сервере Zabbix. Необходимо для активных проверок и должно соответствовать имени узла, указанному на сервере."
|
||||
|
||||
msgid "Server"
|
||||
msgstr "Server"
|
||||
|
||||
msgid "List of IP addresses (or hostnames) of Zabbix servers allowed to connect to this agent. If 0.0.0.0/0 is specified, the agent will accept connections from any IP address."
|
||||
msgstr "Список IP-адресов (или имён хостов) серверов Zabbix, которым разрешено подключаться к этому агенту. Если указать 0.0.0.0/0, агент будет принимать подключения с любого IP-адреса."
|
||||
|
||||
msgid "IP address of the local network interfaces on which the Zabbix agent will listen for incoming connections from the server."
|
||||
msgstr "IP-адрес локальных сетевых интерфейсов, на которых Zabbix-агент будет ожидать входящие соединения от сервера."
|
||||
|
||||
msgid "ListenPort"
|
||||
msgstr "ListenPort"
|
||||
|
||||
msgid "The agent will listen on this port for connections from the server."
|
||||
msgstr "Агент будет слушать этот порт для подключений с сервера."
|
||||
|
||||
msgid "TLSAccept"
|
||||
msgstr "TLSAccept"
|
||||
|
||||
msgid "The parameter defines which types of TLS connections the agent will accept."
|
||||
msgstr "Параметр определяет, какие типы TLS-соединений агент будет принимать."
|
||||
|
||||
msgid "without encryption"
|
||||
msgstr "без шифрования"
|
||||
|
||||
msgid "pre-shared key"
|
||||
msgstr "pre-shared ключ"
|
||||
|
||||
msgid "certificate"
|
||||
msgstr "сертификат"
|
||||
|
||||
msgid "ServerActive"
|
||||
msgstr "ServerActive"
|
||||
|
||||
msgid "IP address or hostname of the Zabbix server for active checks. If the parameter is not specified, active checks are disabled."
|
||||
msgstr "IP адрес или имя хоста Zabbix-сервера для активных проверок. Если параметр не указан, активные проверки отключены."
|
||||
|
||||
msgid "TLSConnect"
|
||||
msgstr "TLSConnect"
|
||||
|
||||
msgid "The parameter defines how the agent should establish a secure connection with the Zabbix server or proxy."
|
||||
msgstr "Параметр определяет, как агент должен устанавливать защищенное соединение с Zabbix-сервером или прокси."
|
||||
|
||||
msgid "TLSPSKIdentity"
|
||||
msgstr "TLSPSKIdentity"
|
||||
|
||||
msgid "Pre-shared key identifier string. Used for unique identification and management of the pre-shared key, ensuring the security of the connection between the agent and the server."
|
||||
msgstr "Строка идентификатор pre-shared ключа. Используется для уникальной идентификации и управления предустановленным ключом, обеспечивая безопасность соединения между агентом и сервером."
|
||||
|
||||
msgid "TLSPSKFile"
|
||||
msgstr "TLSPSKFile"
|
||||
|
||||
msgid "Agent pre-shared key."
|
||||
msgstr "Pre-shared ключ агента."
|
||||
|
||||
msgid "TLSCAFile"
|
||||
msgstr "TLSCAFile"
|
||||
|
||||
msgid "Root CA certificate. Used for encrypted connections between Zabbix components."
|
||||
msgstr "Сертификат верхнего уровня CA. Используется для зашифрованных соединений между Zabbix компонентами."
|
||||
|
||||
msgid "TLSCertFile"
|
||||
msgstr "TLSCertFile"
|
||||
|
||||
msgid "Agent certificate or certificate chain used to establish secure (TLS/SSL) connections between Zabbix components."
|
||||
msgstr "Сертификат агента или цепочка сертификатов, используемых для установления защищенных (TLS/SSL) соединений между компонентами Zabbix."
|
||||
|
||||
msgid "TLSKeyFile"
|
||||
msgstr "TLSKeyFile"
|
||||
|
||||
msgid "Agent private key."
|
||||
msgstr "Приватный ключ агента."
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/sh
|
||||
[ ! -f "/usr/share/ucitrack/luci-app-zabbix.json" ] && {
|
||||
cat > /usr/share/ucitrack/luci-app-zabbix.json << EEOF
|
||||
{
|
||||
"config": "zabbix",
|
||||
"init": "zabbix"
|
||||
}
|
||||
EEOF
|
||||
}
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@zabbix[-1]
|
||||
add ucitrack zabbix
|
||||
set ucitrack.@zabbix[-1].init=zabbix_agentd
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"admin/services/zabbix": {
|
||||
"title": "Zabbix Agent",
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "zabbix/zabbix"
|
||||
},
|
||||
"depends": {
|
||||
"acl": [ "luci-app-zabbix" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"luci-app-zabbix": {
|
||||
"description": "Grant UCI access for luci-app-zabbix",
|
||||
"read": {
|
||||
"uci": [ "zabbix" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "zabbix" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=my-default-settings
|
||||
PKG_VERSION:=2
|
||||
PKG_RELEASE:=8
|
||||
PKG_RELEASE:=9
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
@@ -49,7 +49,9 @@ fi
|
||||
|
||||
if [ -z "$version" ] || [ "$version" -lt 1 ]; then
|
||||
uci -q set luci.main.lang='auto'
|
||||
uci -q set luci.main.mediaurlbase=/luci-static/footstrap
|
||||
if [ -f /usr/share/rpcd/acl.d/luci-theme-footstrap.json ]; then
|
||||
uci -q set luci.main.mediaurlbase=/luci-static/footstrap
|
||||
fi
|
||||
uci commit luci
|
||||
|
||||
if uci -q get system.@system[0] >/dev/null; then
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=zabbix-config
|
||||
PKG_VERSION:=1
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/zabbix-config
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/zabbix-config
|
||||
SECTION:=admin
|
||||
CATEGORY:=Administration
|
||||
SUBMENU:=Zabbix
|
||||
TITLE:=Zabbix-config
|
||||
TITLE:=Additional configuration and init for zabbix-agent
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Package/zabbix-config/description
|
||||
This package contains a changed config and init file for zabbix_agentd
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/zabbix-config/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_BIN) ./files/zabbix_agentd.conf $(1)/etc/zabbix_agentd.conf
|
||||
$(INSTALL_DIR) $(1)/etc/zabbix_agentd.conf.d
|
||||
$(INSTALL_BIN) ./files/device_template.conf $(1)/etc/zabbix_agentd.conf.d/
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(CP) ./files/zabbix.config $(1)/etc/config/zabbix
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/zabbix_agentd.init $(1)/etc/init.d/zabbix_agentd
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,zabbix-config))
|
||||
@@ -1,18 +0,0 @@
|
||||
###DEVICE###
|
||||
UserParameter=device_hostname,getinfo hostname
|
||||
UserParameter=device_serial,getinfo serialnum
|
||||
UserParameter=device_fw,getinfo release
|
||||
UserParameter=device_voltage,getinfo voltage
|
||||
UserParameter=device_temp,getinfo temp
|
||||
UserParameter=device_uptime,getinfo uptime
|
||||
#MODEM
|
||||
UserParameter=modem_imei,getinfo imei
|
||||
UserParameter=modem_data,getinfo packtype
|
||||
UserParameter=modem_operator,getinfo operator
|
||||
UserParameter=modem_csq,getinfo signal
|
||||
UserParameter=modem_sim_imsi,getinfo imsi
|
||||
UserParameter=modem_sim_ccid,getinfo ccid
|
||||
UserParameter=modem_sim_state,getinfo simstatus
|
||||
#MWAN3
|
||||
UserParameter=wan_ip,getinfo wanip
|
||||
UserParameter=current_wan,getinfo currentwan
|
||||
@@ -1,3 +0,0 @@
|
||||
config zabbix
|
||||
option enabled '0'
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
LogType=system
|
||||
StartAgents=1
|
||||
AllowRoot=1
|
||||
Include=/etc/zabbix_agentd.conf.d/
|
||||
Include=/tmp/zabbix_agentd.conf
|
||||
@@ -1,93 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2008-2011 OpenWrt.org
|
||||
|
||||
START=60
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/zabbix_agentd
|
||||
CONFIG=/etc/zabbix_agentd.conf
|
||||
TMP_CONFIG=/tmp/zabbix_agentd.conf
|
||||
|
||||
start_service_daemon() {
|
||||
config_get enabled "$1" enabled
|
||||
config_get hostname "$1" hostname
|
||||
config_get server "$1" server
|
||||
config_get listen_ip "$1" listen_ip
|
||||
config_get listen_port "$1" listen_port
|
||||
config_get tls_accept "$1" tls_accept
|
||||
config_get server_active "$1" server_active
|
||||
config_get tls_connect "$1" tls_connect
|
||||
config_get tls_psk_identity "$1" tls_psk_identity
|
||||
config_get tls_psk_file "$1" tls_psk_file
|
||||
config_get tls_ca_file "$1" tls_ca_file
|
||||
config_get tls_cert_file "$1" tls_cert_file
|
||||
config_get tls_key_file "$1" tls_key_file
|
||||
|
||||
[ -f ${CONFIG} ] || return 1
|
||||
|
||||
[ "$enabled" = 0 ] && {
|
||||
echo "service disabled"
|
||||
return 0
|
||||
}
|
||||
|
||||
[ -z "${server}" -o -z "${hostname}" ] && {
|
||||
echo "hostname or server are not set"
|
||||
return 0
|
||||
}
|
||||
|
||||
#FIXME
|
||||
[ -f ${TMP_CONFIG} ] && rm ${TMP_CONFIG}
|
||||
touch ${TMP_CONFIG}
|
||||
|
||||
server=$(echo ${server} | sed -r 's/[ ]+/,/g')
|
||||
echo "Server=${server}" >> ${TMP_CONFIG}
|
||||
echo "Hostname=${hostname}" >> ${TMP_CONFIG}
|
||||
|
||||
[ -n "${listen_ip}" ] && echo "ListenIP=${listen_ip}" >> ${TMP_CONFIG}
|
||||
[ -n "${listen_port}" ] && echo "ListenPort=${listen_port}" >> ${TMP_CONFIG}
|
||||
[ -n "${tls_accept}" ] && {
|
||||
tls_accept=$(echo ${tls_accept} | sed -r 's/[ ]+/,/g')
|
||||
echo "TLSAccept=${tls_accept}" >> ${TMP_CONFIG}
|
||||
}
|
||||
|
||||
[ -n "${server_active}" ] && echo "ServerActive=${server_active}" >> ${TMP_CONFIG}
|
||||
[ -n "${tls_connect}" ] && echo "TLSConnect=${tls_connect}" >> ${TMP_CONFIG}
|
||||
[ -n "${tls_psk_identity}" ] && echo "TLSPSKIdentity=${tls_psk_identity}" >> ${TMP_CONFIG}
|
||||
[ -n "${tls_psk_file}" ] && {
|
||||
echo "TLSPSKFile=${tls_psk_file}" >> ${TMP_CONFIG}
|
||||
chmod 644 ${tls_psk_file}
|
||||
}
|
||||
[ -n "${tls_ca_file}" ] && {
|
||||
echo "TLSCAFile=${tls_ca_file}" >> ${TMP_CONFIG}
|
||||
chmod 644 ${tls_ca_file}
|
||||
}
|
||||
[ -n "${tls_cert_file}" ] && {
|
||||
echo "TLSCertFile=${tls_cert_file}" >> ${TMP_CONFIG}
|
||||
chmod 644 ${tls_cert_file}
|
||||
}
|
||||
[ -n "${tls_key_file}" ] && {
|
||||
echo "TLSKeyFile=${tls_key_file}" >> ${TMP_CONFIG}
|
||||
chmod 644 ${tls_key_file}
|
||||
}
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG} -c ${CONFIG} -f
|
||||
procd_set_param respawn
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
start_service(){
|
||||
config_load 'zabbix'
|
||||
config_foreach start_service_daemon 'zabbix'
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger 'zabbix'
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2006-2015 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=zabbix-ssl
|
||||
PKG_VERSION:=5.0.8
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=zabbix-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://cdn.zabbix.com/zabbix/sources/stable/5.0/
|
||||
PKG_HASH:=skip
|
||||
|
||||
PKG_BUILD_DIR=$(BUILD_DIR)/zabbix-$(PKG_VERSION)
|
||||
PKG_MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
PKG_CPE_ID:=cpe:/a:zabbix:zabbix
|
||||
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/zabbix-ssl/Default
|
||||
SECTION:=admin
|
||||
CATEGORY:=Administration
|
||||
SUBMENU:=Zabbix
|
||||
TITLE:=Zabbix-ssl
|
||||
URL:=https://www.zabbix.com/
|
||||
USERID:=zabbix=53:zabbix=53
|
||||
DEPENDS += $(ICONV_DEPENDS) +libpcre2 +zlib +libopenssl +libmariadbclient
|
||||
endef
|
||||
|
||||
define Package/zabbix-agentd-ssl
|
||||
$(call Package/zabbix-ssl/Default)
|
||||
TITLE+= agentd-ssl
|
||||
DEPENDS += +libpq
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
--enable-agent \
|
||||
--enable-proxy \
|
||||
$(call autoconf_bool,CONFIG_IPV6,ipv6) \
|
||||
--disable-java \
|
||||
--with-mysql \
|
||||
--with-libevent=$(STAGING_DIR)/usr/include/libevent \
|
||||
--with-libpcre=$(STAGING_DIR)/usr/include \
|
||||
--with-zlib=$(STAGING_DIR)/usr/include \
|
||||
--with-openssl="$(STAGING_DIR)/usr"
|
||||
|
||||
CONFIGURE_VARS += \
|
||||
ac_cv_header_sys_sysinfo_h=no
|
||||
|
||||
MAKE_FLAGS += ARCH="linux"
|
||||
|
||||
define Package/zabbix-ssl/install/sbin
|
||||
$(INSTALL_DIR) \
|
||||
$(1)/usr/sbin
|
||||
|
||||
$(INSTALL_BIN) \
|
||||
$(PKG_INSTALL_DIR)/usr/sbin/zabbix_$(2) \
|
||||
$(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/zabbix-ssl/install/bin
|
||||
$(INSTALL_DIR) \
|
||||
$(1)/usr/bin
|
||||
|
||||
$(INSTALL_BIN) \
|
||||
$(PKG_INSTALL_DIR)/usr/bin/zabbix_$(2) \
|
||||
$(1)/usr/bin/
|
||||
endef
|
||||
|
||||
define Package/zabbix-ssl/install/etc
|
||||
$(INSTALL_DIR) \
|
||||
$(1)/etc
|
||||
|
||||
$(INSTALL_CONF) \
|
||||
$(PKG_INSTALL_DIR)/etc/zabbix_$(2).conf \
|
||||
$(1)/etc/
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(call Build/Compile/Default)
|
||||
endef
|
||||
|
||||
define Package/zabbix-agentd-ssl/install
|
||||
$(INSTALL_DIR) $(1)/etc/zabbix_agentd.conf.d
|
||||
$(call Package/zabbix-ssl/install/sbin,$(1),agentd)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,zabbix-agentd-ssl))
|
||||
@@ -1,29 +0,0 @@
|
||||
#see https://openwrt.org/docs/guide-user/services/network_monitoring/zabbix for ready to use templates
|
||||
|
||||
# If you want to know the exact meaning of an UserParameter, you can search in the ieee80211 standard:
|
||||
# https://standards.ieee.org/getieee802/download/802.11-2012.pdf
|
||||
# example: for mac80211.ACKFailureCount search for dot11ACKFailureCount (page 2145)
|
||||
|
||||
# mac80211 phy discovery (like 'phy0')
|
||||
# example: {"data":[{"{#PHY}":"phy0"}]}
|
||||
#
|
||||
UserParameter=mac80211.phydiscovery,zabbix_helper_mac80211 discovery
|
||||
|
||||
#phy statistics (you need {#PHY} as parameter)
|
||||
#
|
||||
UserParameter=mac80211.ACKFailureCount[*],zabbix_helper_mac80211 $1 dot11ACKFailureCount
|
||||
UserParameter=mac80211.FCSErrorCount[*],zabbix_helper_mac80211 $1 dot11FCSErrorCount
|
||||
UserParameter=mac80211.RTSFailureCount[*],zabbix_helper_mac80211 $1 dot11RTSFailureCount
|
||||
UserParameter=mac80211.RTSSuccessCount[*],zabbix_helper_mac80211 $1 dot11RTSSuccessCount
|
||||
|
||||
# hidden behind MAC80211_DEBUG_COUNTERS
|
||||
UserParameter=mac80211.FailedCount[*],zabbix_helper_mac80211 $1 dot11FailedCount
|
||||
UserParameter=mac80211.FrameDuplicateCount[*],zabbix_helper_mac80211 $1 dot11FrameDuplicateCount
|
||||
UserParameter=mac80211.MulticastReceivedFrameCount[*],zabbix_helper_mac80211 $1 dot11MulticastReceivedFrameCount
|
||||
UserParameter=mac80211.MulticastTransmittedFrameCount[*],zabbix_helper_mac80211 $1 dot11MulticastTransmittedFrameCount
|
||||
UserParameter=mac80211.MultipleRetryCount[*],zabbix_helper_mac80211 $1 dot11MultipleRetryCount
|
||||
UserParameter=mac80211.ReceivedFragmentCount[*],zabbix_helper_mac80211 $1 dot11ReceivedFragmentCount
|
||||
UserParameter=mac80211.RetryCount[*],zabbix_helper_mac80211 $1 dot11RetryCount
|
||||
UserParameter=mac80211.TransmittedFragmentCount[*],zabbix_helper_mac80211 $1 dot11TransmittedFragmentCount
|
||||
UserParameter=mac80211.TransmittedFrameCount[*],zabbix_helper_mac80211 $1 dot11TransmittedFrameCount
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#see https://openwrt.org/docs/guide-user/services/network_monitoring/zabbix for ready to use templates
|
||||
|
||||
# network interface discovery
|
||||
# example: {"data":[{"{#IF}":"lo", "{#NET}":"loopback"},{"{#IF}":"br-lan", "{#NET}":"lan"},{"{#IF}":"eth0.1", "{#NET}":"wan"}]}
|
||||
#
|
||||
UserParameter=netowrt.discovery,lua -l ubus -e 'u=ubus.connect();list="{\"data\":[";dump=u:call("network.interface", "dump", {});for _, intf in ipairs(dump.interface) do list=list.."{\"{#IF}\":\""..intf.device.."\", \"{#NET}\":\""..intf.interface.."\"},";end;list=string.gsub(list,",$","");print(list.."]}")'
|
||||
@@ -1,24 +0,0 @@
|
||||
#see https://openwrt.org/docs/guide-user/services/network_monitoring/zabbix for ready to use templates
|
||||
|
||||
# wifi interface discovery
|
||||
# example: {"data":[{"{#IF}":"wlan0", "{#MODE}":"ap", "{#SSID}":"Openwrt", "{#NET}":"lan", "{#DEV}":"radio0", "{#ENC}":"psk2+ccmp", "{#TYPE}":"mac80211", "{#HWMODE}":"11ng", "{#CHANNEL}":"11", "{#BSSID}":"xx:xx:xx:xx:xx:xx"}]}
|
||||
UserParameter=wifi.ifdiscovery, lua -l ubus -l iwinfo -e 'u=ubus.connect();list="{\"data\":[";stat=u:call("network.wireless", "status", {});for dev, dev_table in pairs(stat) do for i, iface in pairs(dev_table["interfaces"]) do c=iface["config"];i=iface["ifname"];t=iwinfo.type(i);iw=iwinfo[t];e = iw.encryption(i);e = e and e.description or "None";n = table.concat(c["network"]," ");list=list.."{\"{#IF}\":\""..i.."\", \"{#MODE}\":\""..iw.mode(i).."\", \"{#SSID}\":\""..c["ssid"].."\", \"{#NET}\":\""..n.."\", \"{#DEV}\":\""..dev.."\", \"{#ENC}\":\""..e.."\", \"{#TYPE}\":\""..t.."\", \"{#HWMODE}\":\"".."?".."\", \"{#CHANNEL}\":\""..iw.channel(i).."\", \"{#BSSID}\":\""..iw.bssid(i).."\"},";end;end;list=string.gsub(list,",$","");print(list.."]}")'
|
||||
|
||||
|
||||
#iwinfo info (you need {#IF} as parameter, like 'wlan0')
|
||||
UserParameter=wifi.iwinfo.channel[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].channel('$1'))"
|
||||
UserParameter=wifi.iwinfo.frequency[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].frequency('$1'))"
|
||||
UserParameter=wifi.iwinfo.txpower[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].txpower('$1'))"
|
||||
UserParameter=wifi.iwinfo.bitrate[*],lua -l iwinfo -e "b = iwinfo[iwinfo.type('$1')].bitrate('$1'); print(b or '0')"
|
||||
UserParameter=wifi.iwinfo.signal[*],lua -l iwinfo -e "s = iwinfo[iwinfo.type('$1')].signal('$1'); print(s or '-255')"
|
||||
UserParameter=wifi.iwinfo.noise[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].noise('$1'))"
|
||||
UserParameter=wifi.iwinfo.quality[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].quality('$1'))"
|
||||
UserParameter=wifi.iwinfo.quality_max[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].quality_max('$1'))"
|
||||
UserParameter=wifi.iwinfo.mode[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].mode('$1'))"
|
||||
UserParameter=wifi.iwinfo.ssid[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].ssid('$1'))"
|
||||
UserParameter=wifi.iwinfo.bssid[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].bssid('$1'))"
|
||||
UserParameter=wifi.iwinfo.country[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].country('$1'))"
|
||||
UserParameter=wifi.iwinfo.nbusers[*],lua -l iwinfo -e "n = 0; for _,_ in pairs(iwinfo[iwinfo.type('$1')].assoclist('$1')) do n = n + 1 end; print(n)"
|
||||
UserParameter=wifi.iwinfo.encryption[*],lua -l iwinfo -e "e = iwinfo[iwinfo.type('$1')].encryption('$1'); print(e and e.description or 'None')"
|
||||
UserParameter=wifi.iwinfo.hwmode[*],lua -l iwinfo -e "x=iwinfo[iwinfo.type('$1')].hwmodelist('$1'); print((x.a and 'a' or '')..(x.b and 'b' or '')..(x.g and 'g' or '')..(x.n and 'n' or ''))"
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"user": "zabbix",
|
||||
"access": {
|
||||
"network.interface": {
|
||||
"methods": [ "dump" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"user": "zabbix",
|
||||
"access": {
|
||||
"network.wireless": {
|
||||
"methods": [ "status" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
int discovery()
|
||||
{
|
||||
DIR *dir;
|
||||
struct dirent *ent;
|
||||
bool comma = false;
|
||||
if ((dir = opendir ("/sys/kernel/debug/ieee80211/")) != NULL) {
|
||||
printf("{\"data\":[");
|
||||
while ((ent = readdir (dir)) != NULL) {
|
||||
if (strcmp(".", ent->d_name) && strcmp("..", ent->d_name)) {
|
||||
if (comma)
|
||||
printf(",");
|
||||
printf("{\"{#PHY}\":\"%s\"}", ent->d_name);
|
||||
comma = true;
|
||||
}
|
||||
}
|
||||
printf("]}\n");
|
||||
closedir(dir);
|
||||
} else {
|
||||
perror("");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
int get_param(char *phy, char *stat)
|
||||
{
|
||||
char *filename = NULL;
|
||||
FILE *f = NULL;
|
||||
phy = basename(phy);
|
||||
stat = basename(stat);
|
||||
if (asprintf(&filename, "/sys/kernel/debug/ieee80211/%s/statistics/%s", phy, stat) > 0)
|
||||
f = fopen(filename, "r");
|
||||
|
||||
if (f != NULL) {
|
||||
char temp[256];
|
||||
while (fgets(temp, 256, f) != NULL)
|
||||
printf("%s",temp);
|
||||
|
||||
fclose(f);
|
||||
} else {
|
||||
perror("");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
free(filename);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
int usage(char *name)
|
||||
{
|
||||
fprintf(stderr, "Usage:\n");
|
||||
fprintf(stderr, " %s discovery\n", name);
|
||||
fprintf(stderr, " => print mac80211.phydiscovery discovery rule\n");
|
||||
fprintf(stderr, " %s PHY STAT\n", name);
|
||||
fprintf(stderr, " => cat /sys/kernel/debug/ieee80211/PHY/statistics/STAT as root\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
switch (argc) {
|
||||
case 2:
|
||||
return discovery();
|
||||
case 3:
|
||||
return get_param(argv[1], argv[2]);
|
||||
default:
|
||||
return usage(argv[0]);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/src/libs/zbxcommon/str.c
|
||||
+++ b/src/libs/zbxcommon/str.c
|
||||
@@ -54,7 +54,7 @@ static const char help_message_footer[]
|
||||
void version(void)
|
||||
{
|
||||
printf("%s (Zabbix) %s\n", title_message, ZABBIX_VERSION);
|
||||
- printf("Revision %s %s, compilation time: %s %s\n\n", ZABBIX_REVISION, ZABBIX_REVDATE, __DATE__, __TIME__);
|
||||
+ printf("Revision %s %s\n\n", ZABBIX_REVISION, ZABBIX_REVDATE);
|
||||
puts(copyright_message);
|
||||
#if defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)
|
||||
printf("\n");
|
||||
Reference in new issue
Block a user