update 2024-02-29 12:20:17

This commit is contained in:
github-actions[bot] 2024-02-29 12:20:17 +08:00
parent 7ba6d3261e
commit 1689d582e1
83 changed files with 2104 additions and 23761 deletions

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -0,0 +1,26 @@
#
# Copyright (C) 2006-2017 OpenWrt.org
# Copyright (C) 2022-2023 sirpdboy <herboy2008@gmail.com>
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for eqosplus.
LUCI_DESCRIPTION:=LuCI support for Easy eqosplus(Support speed limit based on IP address).
LUCI_DEPENDS:=+bash +tc +kmod-sched-core +kmod-ifb +kmod-sched +iptables-mod-filter +iptables-mod-nat-extra
LUCI_PKGARCH:=all
PKG_VERSION:=1.2.2
PKG_RELEASE:=20230719
PKG_MAINTAINER:=sirpdboy <herboy2008@gmail.com>
define Package/$(PKG_NAME)/conffiles
/etc/config/eqosplus
endef
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

107
luci-app-eqosplus/README.md Normal file
View File

@ -0,0 +1,107 @@
## 访问数:![hello](https://views.whatilearened.today/views/github/sirpdboy/deplives.svg)[![](https://img.shields.io/badge/TG群-点击加入-FFFFFF.svg)](https://t.me/joinchat/AAAAAEpRF88NfOK5vBXGBQ)
[eqosplus 定时限速插件](https://github.com/sirpdboy/luci-app-eqosplus)
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明1.jpg)
**认真阅读完毕** 本页面,本页面包含注意事项和如何使用。
## 功能说明:
### 定时限速1.2.2版
#### 2023.7.19 定时限速1.2.2增加更多日期工作日和休息日自定义日期123中间用逗号分隔;加入MAC地址限速从此不用担心IPV6和IPV4的限速问题。
### 定时限速1.0版
#### 2022.12.24 定时限速在eqos的加强版加入定时限制等功能。
## 编译使用方法 [![](https://img.shields.io/badge/-编译使用方法-F5F5F5.svg)](#编译使用方法-)
将luci-app-eqosplus添加至 LEDE/OpenWRT 源码的方法。
### 下载源码方法一:
编辑源码文件夹根目录feeds.conf.default并加入如下内容:
```Brach
# feeds获取源码
src-git eqosplus https://github.com/sirpdboy/luci-app-eqosplus
```
```Brach
# 更新feeds并安装主题
scripts/feeds update eqosplus
scripts/feeds install luci-app-eqosplus
```
### 下载源码方法:
```Brach
# 下载源码
git clone https://github.com/sirpdboy/luci-app-eqosplus package/luci-app-eqosplus
make menuconfig
```
### 配置菜单
```Brach
make menuconfig
# 找到 LuCI -> Applications, 选择 luci-app-eqosplus, 保存后退出。
```
### 编译
```Brach
# 编译固件
make package/luci-app-eqosplus/compile V=s
```
## 说明 [![](https://img.shields.io/badge/-说明-F5F5F5.svg)](#说明-)
源码来源https://github.com/sirpdboy/luci-app-eqosplus
- 你可以随意使用其中的源码,但请注明出处。
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明2.jpg)
## 界面
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/eqosplus.png)
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/eqosplus2.png)
## 使用与授权相关说明
- 本人开源的所有源码,任何引用需注明本处出处,如需修改二次发布必告之本人,未经许可不得做于任何商用用途。
# My other project
- 网络速度测试 https://github.com/sirpdboy/NetSpeedTest
- 任务设置(定时和开机二合一)插件 : https://github.com/sirpdboy/luci-app-autotimeset
- 关机功能插件 : https://github.com/sirpdboy/luci-app-poweroffdevice
- opentopd主题 : https://github.com/sirpdboy/luci-theme-opentopd
- kucat 主题: https://github.com/sirpdboy/luci-theme-kucat
- 家长控制: https://github.com/sirpdboy/luci-theme-parentcontrol
- 系统高级设置 : https://github.com/sirpdboy/luci-app-advanced
- ddns-go动态域名: https://github.com/sirpdboy/luci-app-ddns-go
- 进阶设置(系统高级设置+主题设置kucat/agron/opentopd: https://github.com/sirpdboy/luci-app-advancedplus
- 设置向导: https://github.com/sirpdboy/luci-app-wizard
- 分区扩容: https://github.com/sirpdboy/luci-app-partexp
- lukcy大吉: https://github.com/sirpdboy/luci-app-lukcy
## 捐助
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明3.jpg)
| <img src="https://img.shields.io/badge/-支付宝-F5F5F5.svg" href="#赞助支持本项目-" height="25" alt="图飞了😂"/> | <img src="https://img.shields.io/badge/-微信-F5F5F5.svg" height="25" alt="图飞了😂" href="#赞助支持本项目-"/> |
| :-----------------: | :-------------: |
|![xm1](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/支付宝.png) | ![xm1](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/微信.png) |
<a href="#readme">
<img src="https://img.shields.io/badge/-返回顶部-orange.svg" alt="图飞了😂" title="返回顶部" align="right"/>
</a>

View File

@ -0,0 +1,16 @@
module("luci.controller.eqosplus", package.seeall)
-- Copyright 2022-2023 sirpdboy <herboy2008@gmail.com>
function index()
if not nixio.fs.access("/etc/config/eqosplus") then return end
entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false
entry({"admin", "control", "eqosplus"}, cbi("eqosplus"), _("Eqosplus"), 10).dependent =true
entry({"admin", "control", "eqosplus", "status"}, call("act_status")).leaf = true
end
function act_status()
local sys = require "luci.sys"
local e = {}
e.status = sys.call(" tc qdisc show | grep 'default' >/dev/null ") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end

View File

@ -0,0 +1,105 @@
-- Copyright 2022-2023 sirpdboy <herboy2008@gmail.com>
-- Licensed to the public under the Apache License 2.0.
local sys = require "luci.sys"
local ifaces = sys.net:devices()
local WADM = require "luci.tools.webadmin"
local ipc = require "luci.ip"
local a, t, e
a = Map("eqosplus", translate("Network speed limit"))
a.description = translate("Users can limit the network speed for uploading/downloading through MAC, IP.The speed unit is MB/second.")..translate("Suggested feedback:")..translate("<a href=\'https://github.com/sirpdboy/luci-app-eqosplus.git' target=\'_blank\'>GitHub @sirpdboy/luci-app-eqosplus </a>")
a.template = "eqosplus/index"
t = a:section(TypedSection, "eqosplus")
t.anonymous = true
e = t:option(DummyValue, "eqosplus_status", translate("Status"))
e.template = "eqosplus/eqosplus"
e.value = translate("Collecting data...")
ipi = t:option(ListValue, "ifname", translate("Interface"), translate("Set the interface used for restriction, use pppoe-wan for dialing, use WAN hardware interface for DHCP mode (such as eth1), and use br-lan for bypass mode"))
ipi.default = "1"
ipi:value(1,translate("Automatic settings"))
ipi.rmempty = false
for _, v in pairs(ifaces) do
net = WADM.iface_get_network(v)
if net and net ~= "loopback" then
ipi:value(v)
end
end
t = a:section(TypedSection, "device")
t.template = "cbi/tblsection"
t.anonymous = true
t.addremove = true
e = t:option(Flag, "enable", translate("Enabled"))
e.rmempty = false
e.size = 4
ip = t:option(Value, "mac", translate("IP/MAC"))
ipc.neighbors({family = 4, dev = "br-lan"}, function(n)
if n.mac and n.dest then
ip:value(n.dest:string(), "%s (%s)" %{ n.dest:string(), n.mac })
end
end)
ipc.neighbors({family = 4, dev = "br-lan"}, function(n)
if n.mac and n.dest then
ip:value(n.mac, "%s (%s)" %{n.mac, n.dest:string() })
end
end)
e.size = 8
dl = t:option(Value, "download", translate("Downloads"))
dl.default = '0.1'
dl.size = 4
ul = t:option(Value, "upload", translate("Uploads"))
ul.default = '0.1'
ul.size = 4
function validate_time(self, value, section)
local hh, mm, ss
hh, mm, ss = string.match (value, "^(%d?%d):(%d%d)$")
hh = tonumber (hh)
mm = tonumber (mm)
if hh and mm and hh <= 23 and mm <= 59 then
return value
else
return nil, "Time HH:MM or space"
end
end
e = t:option(Value, "timestart", translate("Start control time"))
e.placeholder = '00:00'
e.default = '00:00'
e.validate = validate_time
e.rmempty = true
e.size = 4
e = t:option(Value, "timeend", translate("Stop control time"))
e.placeholder = '00:00'
e.default = '00:00'
e.validate = validate_time
e.rmempty = true
e.size = 4
week=t:option(Value,"week",translate("Week Day(1~7)"))
week.rmempty = true
week:value('0',translate("Everyday"))
week:value(1,translate("Monday"))
week:value(2,translate("Tuesday"))
week:value(3,translate("Wednesday"))
week:value(4,translate("Thursday"))
week:value(5,translate("Friday"))
week:value(6,translate("Saturday"))
week:value(7,translate("Sunday"))
week:value('1,2,3,4,5',translate("Workday"))
week:value('6,7',translate("Rest Day"))
week.default='0'
week.size = 6
comment = t:option(Value, "comment", translate("Comment"))
comment.size = 8
return a

View File

@ -0,0 +1,3 @@
<%+cbi/valueheader%>
<font class="eqosplus_status"><%=pcdata(self:cfgvalue(section) or self.default or "")%></font>
<%+cbi/valuefooter%>

View File

@ -0,0 +1,12 @@
<% include("cbi/map") %>
<script type="text/javascript">//<![CDATA[
XHR.poll(2, '<%=luci.dispatcher.build_url("admin", "control", "eqosplus", "status" )%>', null,
function (x, result) {
var status = document.getElementsByClassName('eqosplus_status')[0];
status.setAttribute("style", "font-weight:bold;");
status.setAttribute("color", result.status ? "green" : "red");
status.innerHTML = result.status ? '<%=translate("RUNNING")%>' : '<%=translate("NOT RUNNING")%>';
}
)
//]]>
</script>

View File

@ -0,0 +1,61 @@
msgid "Eqosplus"
msgstr "定时限速"
msgid "Network speed limit"
msgstr "定时网速限制"
msgid "Running state"
msgstr "运行状态"
msgid "Not running"
msgstr "未运行"
msgid "Running"
msgstr "已运行"
msgid "Users can limit the network speed for uploading/downloading through MAC, IP.The speed unit is MB/second."
msgstr "可以通过MACIP限制用户上传/下载的网速。速度单位为<font color=\"red\"><b> MB/秒 </b></font>。"
msgid "MAC/IP"
msgstr "MAC/IP"
msgid "Downloads"
msgstr "下载速度"
msgid "Uploads"
msgstr "上传速度"
msgid "Comment"
msgstr "备注"
msgid "Upload bandwidth(Mbit/s)"
msgstr "上传总带宽(Mbit/s)"
msgid "Download bandwidth(Mbit/s)"
msgstr "下载总带宽(Mbit/s)"
msgid "Start control time"
msgstr "起控时间"
msgid "Stop control time"
msgstr "停控时间"
msgid "Week Day(1~7)"
msgstr "星期(1~7)"
msgid "Suggested feedback:"
msgstr "建议反馈:"
msgid "Set the interface used for restriction, use pppoe-wan for dialing, use WAN hardware interface for DHCP mode (such as eth1), and use br-lan for bypass mode"
msgstr "设定用来限制网络速度的接口,拨号使用pppoe-wan,DHCP模式使用WAN口的硬件接口(如:eth1),通用使用br-lan接口"
msgid "Rest Day"
msgstr "休息日"
msgid "Workday"
msgstr "工作日"
msgid "Automatic settings"
msgstr "自动设置"

View File

@ -0,0 +1 @@
zh-cn

View File

@ -0,0 +1,27 @@
config eqosplus
option enabled '0'
option download '1000'
option upload '30'
option ifname '1'
config device
option timestart '00:00'
option week '0'
option download '1'
option timeend '23:55'
option upload '1'
option mac ''
option enable '0'
config device
option mac '192.168.10.10/24'
option timestart '00:00'
option timeend '00:00'
option week '0'
option download '0.1'
option upload '0.1'
option enable '0'

View File

@ -0,0 +1,54 @@
#!/bin/sh /etc/rc.common
#
# Copyright (C) 2023 sirpdboy herboy2008@gmail.com
#
START=99
USE_PROCD=1
NAME=eqosplus
LOCK="/var/lock/$NAME.lock"
CR=/etc/crontabs/root
start_instance() {
procd_open_instance
procd_set_param command /usr/sbin/eqosplusctrl
procd_set_param respawn
procd_set_param stderr 1
procd_close_instance
}
_eqosplus_start() {
if [ "$(grep -c 'option enable .1.' /etc/config/$NAME 2>/dev/null)" -gt "0" ]; then
if [ x$(uci -q get turboacc.config.sw_flow) = 'x1' ] || [ x$(uci -q get turboacc.config.sfe_flow) = 'x1' ] ;then
uci -q set turboacc.config.sw_flow='0'
uci -q set turboacc.config.sfe_flow='0'
uci -q set turboacc.config.hw_flow='0'
uci commit turboacc
/etc/init.d/turboacc restart
fi
touch $LOCK
eqosplus start
start_instance
(crontab -l ; echo "00 1 * * * /etc/init.d/eqosplus start") | sort - | uniq - | crontab -
fi
}
start_service(){
[ -f $LOCK ] && exit
stop_service
_eqosplus_start
rm -f $LOCK
}
service_triggers() {
procd_add_reload_trigger 'eqosplus'
}
stop_service(){
kill -9 $(busybox ps -w | grep 'eqosplusctrl' | grep -v 'grep' | awk '{print $1}') >/dev/null 2>&1
sed -i '/eqosplus/d' $CR >/dev/null 2>&1
rm -f $LOCK 2>/dev/null
eqosplus stop
}

View File

@ -0,0 +1,13 @@
#!/bin/sh
chmod +x /etc/init.d/eqosplus /usr/bin/eqosplus
uci -q batch <<-EOF >/dev/null
delete ucitrack.@eqosplus[-1]
add ucitrack eqosplus
set ucitrack.@eqosplus[-1].init=eqosplus
commit ucitrack
EOF
[ -s /etc/config/eqosplus ] || echo "config eqosplus" > /etc/config/eqosplus
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,242 @@
#!/bin/bash
# Copyright (C) 2006 OpenWrt.org
# Copyright 2022-2023 sirpdboy <herboy2008@gmail.com>
crrun=$1
crid=$2
NAME=eqosplus
IDLIST="/var/$NAME.idlist"
LOCK="/var/lock/$NAME.lock"
TMPID="/var/$NAME.tmpid"
if [ x$(uci get $NAME.@$NAME[0].ifname) = 'x1' ] ;then
dev=`ifconfig | grep "Point-to-Point" | cut -d " " -f1`
# [ ! ${dev} ] && dev=` uci -q get network.wan.ifname ` || dev=` uci -q get network.wan.device `
[ ! ${dev} ] && dev=br-lan
else
dev=`uci -q get $NAME.@$NAME[0].ifname `
fi
# [ x$(uci get eqosplus.@eqosplus[0].forced) = 'x1' ] && forced="default $id" || forced='default 999'
bin_iptables=$(which iptables)
bin_ip6tables=$(which ip6tables)
bin_tc=$(which tc)
bin_ebtables=$(which ebtables)
bin_ip=$(which ip)
# Uncomment this to debug commands
DEBUG=1
## End
# Debug functions - echo + run
dbg_iptables() {
[ "${DEBUG:-0}" -eq 0 ] || echo "D: iptables $@"
$bin_iptables "$@"
}
dbg_ip6tables() {
[ "${DEBUG:-0}" -eq 0 ] || echo "D: ip6tables $@"
$bin_ip6tables "$@"
}
dbg_tc() {
[ "${DEBUG:-0}" -eq 0 ] || echo "D: tc $@"
$bin_tc "$@"
}
dbg_ebtables() {
[ "${DEBUG:-0}" -eq 0 ] || echo "D: ebtables $@"
$bin_ebtables "$@"
}
dbg_ip() {
[ "${DEBUG:-0}" -eq 0 ] || echo "D: ip $@"
$bin_ip "$@"
}
is_macaddr() {
ret=1
if echo "$1" | grep -qE '^([0-9A-Fa-f]{2}[-:]){5}[0-9A-Fa-f]{2}$'; then
ret=0
fi
return $ret
}
# Default commands
iptables="dbg_iptables"
ip6tables="dbg_ip6tables"
tc="dbg_tc"
ip="dbg_ip"
ebt="dbg_ebtables"
ipt=$iptables
ipt6=$ip6tables
ipt(){
$iptables $@
$ip6tables $@
}
iptm(){
$iptables "-t mangle $@"
$ip6tables "-t mangle $@"
}
stop_qos() {
for face in $( tc qdisc show | grep htb | awk '{print $5}');do
$tc qdisc del dev $face root
done
$tc qdisc del dev ${dev} root 2>/dev/null
$tc qdisc del dev ${dev}_ifb root 2>/dev/null
$tc qdisc del dev ${dev} ingress 2>/dev/null
$ip link del dev ${dev}_ifb 2>/dev/null
}
init_qosplus() {
$ip link add dev ${dev}_ifb name ${dev}_ifb type ifb
$ip link set dev ${dev}_ifb up
$tc qdisc add dev ${dev} root handle 1:0 htb default 1
$tc class add dev ${dev} parent 1:0 classid 1:1 htb rate 80gbit prio 0 quantum 1500
$tc qdisc add dev ${dev}_ifb root handle 1:0 htb default 1
$tc class add dev ${dev}_ifb parent 1:0 classid 1:1 htb rate 80gbit prio 0 quantum 1500
lanipaddr=$(uci -q get network.lan.ipaddr 2>/dev/null | awk -F '.' '{print $1"."$2"."$3".0/24"}')
$tc filter add dev $dev parent 1:0 protocol ipv4 prio 1 u32 match ip src "$lanipaddr" match ip dst "$lanipaddr" flowid 1:1
$tc filter add dev ${dev}_ifb parent 1:0 protocol ipv4 prio 1 u32 match ip src "$lanipaddr" match ip dst "$lanipaddr" flowid 1:1
$tc qdisc add dev ${dev} ingress
$tc filter add dev ${dev} parent ffff: protocol all prio 2 u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev ${dev}_ifb
}
del_id() {
id=`expr $1 + 11 `
[ "${DEBUG:-0}" -eq 0 ] || echo "D: del_id $@" "--$id --$mac"
$tc qd del dev ${dev} parent 1:$id
$tc qd del dev ${dev}_ifb parent 1:$id
$tc class del dev ${dev} parent 1:1 classid 1:$id
$tc class del dev ${dev}_ifb parent 1:1 classid 1:$id
$tc filter del dev ${dev}_ifb pref $id
$tc filter del dev ${dev} pref $id
$tc filter del dev ${dev}_ifb pref 6
$tc filter del dev ${dev} pref 6
$tc filter del dev ${dev}_ifb pref 5
$tc filter del dev ${dev} pref 5
}
add_mac() {
id=`expr $1 + 11 `
A=`echo $mac | awk -F '[-:]' '{print $1$2}'`
B=`echo $mac | awk -F '[-:]' '{print $3$4$5$6}'`
C=`echo $mac | awk -F '[-:]' '{print $1$2$3$4}'`
D=`echo $mac | awk -F '[-:]' '{print $5$6}'`
[ "${DEBUG:-0}" -eq 0 ] || echo "D: add_mac $@ --id:$id --mac:$mac ABCD--$A-$B-$C-$D"
if [ "$UL" -gt 0 ]; then
$tc class add dev ${dev}_ifb parent 1:1 classid 1:$id htb rate "$UL"kbit ceil "$UL"kbit prio $id quantum 1500
$tc qdisc add dev ${dev}_ifb parent 1:"$id" handle "$id": sfq perturb 1
# $tc filter add dev ${dev}_ifb parent 1:0 protocol ip prio $id u32 match u16 0x0800 0xffff at -2 match u16 0x"$D" 0xffff at -4 match u32 0x"$C" 0xffffffff at -8 flowid 1:$id
# $tc filter add dev ${dev}_ifb parent 1: protocol ip prio $id u32 match u16 0x0800 0xFFFF at -2 match u32 0x"$C" 0xFFFFFFFF at -12 flowid 1:$id
$tc filter add dev ${dev}_ifb parent 1: protocol ip prio 1 u32 match u16 0xAAAA at 6 match u32 0x"$C" 0x"$B" police rate "$UL"kbit burst 10k drop flowid 1:$id
elif [ "$UL" == 0 ]; then
$tc filter add dev ${dev}_ifb parent 1:0 protocol ip prio 5 u32 match u16 0x0800 0xffff at -2 match u16 0x"$D" 0xffff at -4 match u32 0x"$C" 0xffffffff at -8 flowid 1:1
fi
if [ "$DL" -gt 0 ]; then
$tc class add dev ${dev} parent 1:1 classid 1:$id htb rate "$DL"kbit ceil "$DL"kbit prio $id quantum 1500
$tc qdisc add dev ${dev} parent 1:"$id" handle "$id": sfq perturb 1
#$tc filter add dev ${dev} parent 1:0 protocol ip prio $id u32 match u16 0x0800 0xffff at -2 match u32 0x"$B" 0xffffffff at -12 match u16 0x"$A" 0xffff at -14 flowid 1:$id
# $tc filter add dev ${dev} parent 1: protocol ip prio $id u32 match u16 0x0800 0xFFFF at -2 match u32 0x"$C" 0xFFFFFFFF at -12 flowid 1:$id
$tc filter add dev ${dev} parent 1: protocol ip prio 1 u32 match u16 0xAAAA at 6 match u32 0x"$C" 0x"$B" police rate "$DL"kbit burst 10k drop flowid 1:$id
elif [ "$DL" == 0 ]; then
$tc filter add dev ${dev} parent 1:0 protocol ip prio 5 u32 match u16 0x0800 0xffff at -2 match u32 0x"$B" 0xffffffff at -12 match u16 0x"$A" 0xffff at -14 flowid 1:1
fi
}
add_ip() {
id=`expr $1 + 11 `
# id=printf "%x\n" "$1"
[ "${DEBUG:-0}" -eq 0 ] || echo "D: add_ip $@ --$id --$mac"
Z=`echo $mac |awk -F '[/]' '{print $2}' `
[ -n "$Z" ] && mac=`echo $mac |awk -F '[/]' '{print $1}' `|| Z=32
if [ "$UL" -gt 0 ]; then
$tc class add dev ${dev}_ifb parent 1:1 classid 1:$id htb rate "$UL"kbit ceil "$UL"kbit prio $id quantum 1500
$tc qdisc add dev ${dev}_ifb parent 1:"$id" handle "$id": sfq perturb 1
$tc filter add dev ${dev}_ifb parent 1:0 prio $id protocol ip u32 match ip src "$mac"/"$Z" classid 1:$id
elif [ "$UL" == 0 ]; then
$tc filter add dev ${dev}_ifb parent 1:0 prio 6 protocol ip u32 match ip src "$mac"/"$Z" classid 1:1
fi
if [ "$DL" -gt 0 ]; then
$tc class add dev ${dev} parent 1:1 classid 1:$id htb rate "$DL"kbit ceil "$DL"kbit prio $id quantum 1500
$tc qdisc add dev ${dev} parent 1:"$id" handle "$id": sfq perturb 1
$tc filter add dev ${dev} parent 1:0 prio $id protocol ip u32 match ip dst "$mac"/"$Z" classid 1:$id
elif [ "$DL" == 0 ]; then
$tc filter add dev ${dev} parent 1:0 prio 6 protocol ip u32 match ip dst "$mac"/"$Z" classid 1:1
fi
}
check_list() {
i=$1
checki='0'
start_time=$(uci -q get $NAME.@device[$i].timestart 2>/dev/null)
end_time=$(uci -q get $NAME.@device[$i].timeend 2>/dev/null)
wweek=`uci -q get $NAME.@device[$i].week `
current_time=$(date +%H:%M)
current_weekday=$(date +%u)
[ "$start_time" = "$end_time" ] || {
[[ "$start_time" < "$end_time" ]] && { [[ "$current_time" > "$start_time" ]] && [[ "$current_time" < "$end_time" ]] || return ; }
[[ "$start_time" > "$end_time" ]] && { [[ "$current_time" < "$start_time" ]] && [[ "$current_time" > "$end_time" ]] || return ; }
}
for ww in `echo $wweek | sed 's/,/ /g' `; do
if [ $current_weekday = $ww ] || [ "x0" = "x$ww" ] ; then
checki='1'
fi
done
return
}
case "$crrun" in
"stop")
stop_qos
echo '' >$IDLIST
;;
"start")
idlist=`uci show $NAME | grep "enable='1'" | grep "device" | grep -oE '\[.*?\]' | grep -o '[0-9]' | sed -e 's/^/!/g' -e 's/$/!/g' > $IDLIST ;cat $IDLIST | sed -e 's/!//g' `
# [ $idlist ] || /etc/init.d/eqosplus stop
cat $IDLIST
init_qosplus
checki='0'
for list in `echo $idlist | sed -e 's/!//g' ` ;do
check_list $list
if [ $checki == '1' ] ; then
mac=$(uci -q get $NAME.@device[$list].mac )
DL=$(uci -q get $NAME.@device[$list].download 2>/dev/null | awk '{print $1*10^3/2}')
UL=$(uci -q get $NAME.@device[$list].upload 2>/dev/null | awk '{print $1*10^3/2}')
if is_macaddr $mac; then
add_mac $list
else
add_ip $list
fi
else
[ `cat $IDLIST 2>/dev/null | grep "!${list}!" | wc -l ` -gt 0 ] && {
del_id $list
sed -i "/!$list!/d" $IDLIST >/dev/null 2>&1
}
fi
done
;;
"add")
for list in `echo $crid | sed -e 's/!//g' | sed 's/,/ /g' ` ;do
mac=$(uci -q get $NAME.@device[$list].mac )
DL=$(uci -q get $NAME.@device[$list].download 2>/dev/null | awk '{print $1*10^3/2}')
UL=$(uci -q get $NAME.@device[$list].upload 2>/dev/null | awk '{print $1*10^3/2}')
if is_macaddr $mac; then
add_mac $list
else
add_ip $list
fi
done
;;
"del")
for list in `echo $crid | sed -e 's/!//g' | sed 's/,/ /g' ` ;do del_id $list; sed -i "/!$list!/d" $IDLIST >/dev/null 2>&1; done
;;
esac

View File

@ -0,0 +1,56 @@
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
# Copyright 2022-2023 sirpdboy <herboy2008@gmail.com>
NAME=eqosplus
IDLIST="/var/$NAME.idlist"
TMPID="/var/$NAME.tmpid"
idlist=`uci show $NAME | grep "enable='1'" | grep "device" | grep -oE '\[.*?\]' | grep -o '[0-9]' `
check_list() {
i=$1
checki='0'
start_time=$(uci -q get $NAME.@device[$i].timestart 2>/dev/null)
end_time=$(uci -q get $NAME.@device[$i].timeend 2>/dev/null)
wweek=`uci -q get $NAME.@device[$i].week `
current_time=$(date +%H:%M)
current_weekday=$(date +%u)
[ "$start_time" = "$end_time" ] || {
[[ "$start_time" < "$end_time" ]] && { [[ "$current_time" > "$start_time" ]] && [[ "$current_time" < "$end_time" ]] || return ; }
[[ "$start_time" > "$end_time" ]] && { [[ "$current_time" < "$start_time" ]] && [[ "$current_time" > "$end_time" ]] || return ; }
}
for ww in `echo $wweek | sed 's/,/ /g' `; do
if [ $current_weekday = $ww ] || [ 'x0' = x$ww ] ;then
checki='1'
fi
done
return $re
}
idlistusr(){
checki='0'
[ -s $IDLIST ] || return
for list in $idlist ;do
check_list $list
if [ $checki == '1' ] ; then
[ `cat $IDLIST 2>/dev/null | grep "!${list}!" | wc -l ` -gt 0 ] || {
eqosplus add $list
echo "!${list}!" >> $IDLIST ; cat $IDLIST | sort | uniq > $TMPID ;cat $TMPID >$IDLIST ;rm -rf $TMPID
}
else
[ `cat $IDLIST 2>/dev/null | grep "!${list}!" | wc -l ` -gt 0 ] && {
eqosplus del $list
sed -i "/!$list!/d" $IDLIST >/dev/null 2>&1
}
fi
done
}
while :;do
sleep 30
idlistusr
sleep 30
done

View File

@ -0,0 +1,11 @@
{
"luci-app-eqosplus": {
"description": "Grant UCI access for luci-app-eqosplus",
"read": {
"uci": [ "eqosplus" ]
},
"write": {
"uci": [ "eqosplus" ]
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 KiB

View File

@ -1,5 +1,6 @@
# Copyright (C) 2016 Openwrt.org
#
# Copyright (C) 2020-2021 sirpdboy <herboy2008@gmail.com>
# https://github.com/sirpdboy/luci-app-netdata for v 1.33.1 cn
# This is free software, licensed under the Apache License, Version 2.0 .
#
@ -10,9 +11,14 @@ LUCI_DEPENDS:=+netdata
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-netdata
PKG_VERSION:=1.0
PKG_RELEASE:=3
PKG_VERSION:=1.2
PKG_RELEASE:=20240227
define Build/Compile
endef
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -1,31 +1,83 @@
# luci-app-netdata
1.33.1 汉化(部分)
## 食用方法
```
rm -rf ./feeds/luci/applications/luci-app-netdata/
git clone https://github.com/Jason6111/luci-app-netdata ./feeds/luci/applications/luci-app-netdata/
```
也可以用web里文件覆盖至路径 `/usr/share/netdata/web/` ,请先备份
### 访问数:[![](https://visitor-badge.glitch.me/badge?page_id=sirpdboy-visitor-badge)] [![](https://img.shields.io/badge/TG群-点击加入-FFFFFF.svg)](https://t.me/joinchat/AAAAAEpRF88NfOK5vBXGBQ)
- dashboard_info.js
- dashboard.js
- main.js
- index.html
已经开启了远程查看权,不需要的手动关闭
`/root/etc/netdata/netdata.conf`
allow connections from = *
allow dashboard from = *
把这两行第一个*删除即可
# 如发现luci进不去netdata请尝试 连接ssh进入openwrt输入以下指令
```
mkdir /usr/lib/lua/luci/view/netdata
mv -f /usr/lib/lua/luci/view/netdata.htm /usr/lib/lua/luci/view/netdata/netdata.htm
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明1.jpg)
```
[luci-app-netdata可控制的实时监控 ](https://github.com/sirpdboy/luci-app-netdata)
======================
# 还原1.33.1(留作以后用)
```
rm -rf ./feeds/packages/admin/netdata
git clone -b 1.33.1 https://github.com/Jason6111/luci-app-netdata ./feeds/packages/admin/netdata
```
### 下载源码方法:
```Brach
# 下载源码
git clone https://github.com/sirpdboy/luci-app-netdata package/luci-app-netdata
make menuconfig
```
### 配置菜单
```Brach
make menuconfig
# 找到 LuCI -> Applications, 选择 luci-app-netdata, 保存后退出。
```
### 编译
```Brach
# 编译固件
make package/luci-app-netdata/compile V=s
```
## 界面
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/netdata1.jpg)
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/netdata2.jpg)
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明2.jpg)
## 使用与授权相关说明
- 本人开源的所有源码,任何引用需注明本处出处,如需修改二次发布必告之本人,未经许可不得做于任何商用用途。
# My other project
- 网络速度测试 https://github.com/sirpdboy/NetSpeedTest
- 定时设置插件 : https://github.com/sirpdboy/luci-app-autotimeset
- 关机功能插件 : https://github.com/sirpdboy/luci-app-poweroffdevice
- opentopd主题 : https://github.com/sirpdboy/luci-theme-opentopd
- kucat 主题: https://github.com/sirpdboy/luci-theme-kucat
- 家长控制: https://github.com/sirpdboy/luci-theme-parentcontrol
- 系统高级设置 : https://github.com/sirpdboy/luci-app-advanced
- ddns-go动态域名: https://github.com/sirpdboy/luci-app-ddns-go
- 进阶设置(系统高级设置+主题设置kucat/agron/opentopd: https://github.com/sirpdboy/luci-app-advancedplus
- 设置向导: https://github.com/sirpdboy/luci-app-wizard
- 分区扩容: https://github.com/sirpdboy/luci-app-partexp
- lukcy大吉: https://github.com/sirpdboy/luci-app-lukcy
## 捐助
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明3.jpg)
| <img src="https://img.shields.io/badge/-支付宝-F5F5F5.svg" href="#赞助支持本项目-" height="25" alt="图飞了😂"/> | <img src="https://img.shields.io/badge/-微信-F5F5F5.svg" height="25" alt="图飞了😂" href="#赞助支持本项目-"/> |
| :-----------------: | :-------------: |
|![xm1](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/支付宝.png) | ![xm1](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/微信.png) |
<a href="#readme">
<img src="https://img.shields.io/badge/-返回顶部-orange.svg" alt="图飞了😂" title="返回顶部" align="right"/>
</a>

View File

@ -1,10 +1,24 @@
-- Copyright (C) 2018-2022 sirpdboy <herboy2008@gmail.com> https://github.com/sirpdboy/luci-app-netdata
-- Licensed to the public under the Apache License 2.0.
module("luci.controller.netdata", package.seeall)
function index()
if not (luci.sys.call("pidof netdata > /dev/null") == 0) then
if not nixio.fs.access("/etc/config/netdata") then
return
end
local fs = require "nixio.fs"
entry({"admin", "status", "netdata"}, template("netdata/netdata"), _("NetData"), 10).leaf = true
local e = entry({"admin", "status", "netdata"}, alias("admin", "status", "netdata", "setting"),_("NetData"), 10)
e.dependent = false
e.acl_depends = { "luci-app-netdata" }
entry({"admin", "status", "netdata", "setting"}, cbi("netdata/netdata"), _("Base Setting"), 20).leaf=true
entry({"admin", "status", "netdata", "netdata"}, template("netdata"), _("NetData"), 30).leaf = true
entry({"admin", "status", "netdata_status"}, call("act_status"))
end
function act_status()
local sys = require "luci.sys"
local e = { }
e.running = sys.call("pidof netdata >/dev/null") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end

View File

@ -0,0 +1,25 @@
-- Copyright 2018-2022 sirpdboy (herboy2008@gmail.com)
-- https://github.com/sirpdboy/luci-app-netdata
require("luci.util")
local m, s ,o
m = Map("netdata", translate("NetData"), translate("Netdata is high-fidelity infrastructure monitoring and troubleshooting.Open-source, free, preconfigured, opinionated, and always real-time.")..translate("</br>For specific usage, see:")..translate("<a href=\'https://github.com/sirpdboy/luci-app-netdata.git' target=\'_blank\'>GitHub @sirpdboy/luci-app-netdata </a>") )
m:section(SimpleSection).template = "netdata_status"
s = m:section(TypedSection, "netdata", translate("Global Settings"))
s.addremove=false
s.anonymous=true
o=s:option(Flag,"enabled",translate("Enable"))
o.default=0
o=s:option(Value, "port",translate("Set the netdata access port"))
o.datatype="uinteger"
o.default=19999
m.apply_on_parse = true
m.on_after_apply = function(self,map)
luci.sys.exec("/etc/init.d/netdata start")
end
return m

View File

@ -1,25 +0,0 @@
-- Copyright 2022 Jason
function index()
o = Map("netdate", "<font color='green'>" .. translate("实时监控") .."</font>", "<font color='purple'>" .. translate( "强大的实时监控数据,需要中文版请点击:【升级中文版】") .."</font>")
t = o:section(TypedSection, "netdate")
t.anonymous = true
t.description = translate(string.format("%s<br /><br />", status))
t:tab("base",translate("Basic Settings"))
e = t:taboption("base", Button, "restart", translate("手动更新"))
e.inputtitle = translate("升级中文版")
e.inputstyle = "reload"
e.write = function()
luci.sys.call("/usr/share/netdata/netdatacn 2>&1 >/dev/null")
luci.http.redirect(luci.dispatcher.build_url("admin","status","netdata"))
end
t=o:section(TypedSection,"rss_rules",translate("技术支持"))
t.anonymous = true
t:append(Template("feedback"))
return o

View File

@ -0,0 +1,33 @@
<%#
Copyright 2008-2024 by sirpdboy <herboy2008@gmail.com>
https://github.com/sirpdboy/luci-app-netdata
Licensed to the public under the Apache License 2.0.
-%>
<%
local running = luci.sys.exec("pidof netdata | awk -F ' ' '{print $1}'")
%>
<%+header%>
<div class="cbi-map">
<% if tonumber(running) ~= nil then %>
<iframe id="netdata" style="width: 100%; min-height: 780px; border: none; border-radius: .375rem;box-shadow: rgba(0, 0, 0, 0.75) 0px 0px 15px -5px;"></iframe>
</div>
<script type="text/javascript">
document.getElementById("netdata").src = window.location.protocol + "//" + window.location.hostname + ":<%=luci.model.uci.cursor():get("netdata", "netdata", "port") %>";
document.getElementById("netdata").height = document.documentElement.clientHeight;
window.onresize = function(){
document.getElementById("netdata").height = document.documentElement.clientHeight;
}
</script>
<% else %>
<style>.running{text-align: center;} .running>h1{font-size: 25px; color: #333; margin: 1rem;} .running>p{ font-size: 1.2rem; color: #8391a2; margin: 1rem;}</style>
<div class="running">
<img src="data:image/svg+xml;base64,PCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMjQiIGhlaWdodD0iMTAyNCIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCI+Cjx0aXRsZT48L3RpdGxlPgo8ZyBpZD0iaWNvbW9vbi1pZ25vcmUiPgo8L2c+CjxwYXRoIGZpbGw9IiNkZjAwMDAiIGQ9Ik05NDIuNDIxIDIzNC42MjRsODAuODExLTgwLjgxMS0xNTMuMDQ1LTE1My4wNDUtODAuODExIDgwLjgxMWMtNzkuOTU3LTUxLjYyNy0xNzUuMTQ3LTgxLjU3OS0yNzcuMzc2LTgxLjU3OS0yODIuNzUyIDAtNTEyIDIyOS4yNDgtNTEyIDUxMiAwIDEwMi4yMjkgMjkuOTUyIDE5Ny40MTkgODEuNTc5IDI3Ny4zNzZsLTgwLjgxMSA4MC44MTEgMTUzLjA0NSAxNTMuMDQ1IDgwLjgxMS04MC44MTFjNzkuOTU3IDUxLjYyNyAxNzUuMTQ3IDgxLjU3OSAyNzcuMzc2IDgxLjU3OSAyODIuNzUyIDAgNTEyLTIyOS4yNDggNTEyLTUxMiAwLTEwMi4yMjktMjkuOTUyLTE5Ny40MTktODEuNTc5LTI3Ny4zNzZ6TTE5NC45NDQgNTEyYzAtMTc1LjEwNCAxNDEuOTUyLTMxNy4wNTYgMzE3LjA1Ni0zMTcuMDU2IDQ4IDAgOTMuNDgzIDEwLjY2NyAxMzQuMjI5IDI5Ljc4MWwtNDIxLjU0NyA0MjEuNTQ3Yy0xOS4wNzItNDAuNzg5LTI5LjczOS04Ni4yNzItMjkuNzM5LTEzNC4yNzJ6TTUxMiA4MjkuMDU2Yy00OCAwLTkzLjQ4My0xMC42NjctMTM0LjIyOS0yOS43ODFsNDIxLjU0Ny00MjEuNTQ3YzE5LjA3MiA0MC43ODkgMjkuNzgxIDg2LjI3MiAyOS43ODEgMTM0LjIyOS0wLjA0MyAxNzUuMTQ3LTE0MS45OTUgMzE3LjA5OS0zMTcuMDk5IDMxNy4wOTl6Ij48L3BhdGg+Cjwvc3ZnPgo=" height="100">
<h1><font color="color:red"><%:The Netdata service is not running.%></font></h1>
<p><%:Please enable the NetData service%></p>
</div>
<% end -%>
</div>
<%+footer%>

View File

@ -1,16 +0,0 @@
<%+header%>
<div class="cbi-map">
<h2 name="content"><%=translate("NetData")%></h2>
<script type="text/javascript">//<![CDATA[
function upnetdata(button) {
(new XHR()).post('<%=controller%>/admin/status/netdata/call', { token: '<%=token%>' }, check);
}
//]]></script>
<iframe id="netdata" style="width: 100%; min-height: 1200px; border: none; border-radius: 3px;"></iframe>
</div>
<script type="text/javascript">
document.getElementById("netdata").src = "http://" + window.location.hostname + ":19999";
</script>
<%+footer%>

View File

@ -0,0 +1,25 @@
<script type="text/javascript">//<![CDATA[
XHR.poll(3, '<%=url([[admin]], [[status]], [[netdata_status]])%>', null,
function(x, d) {
var tb = document.getElementById('netdata_status');
if (d && tb)
{
if (d.running)
{
tb.innerHTML = '<em style=\"color:green\"><%:The Netdata service is running.%></em>';
}
else
{
tb.innerHTML = '<em style=\"color:red\"><%:The Netdata service is not running.%></em>';
}
}
}
);
//]]></script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<legend><%:NetData Status%></legend>
<p id="netdata_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>

View File

@ -1,5 +1,32 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Running state"
msgstr "运行状态"
msgid "The Netdata service is running."
msgstr "NetData服务已启动"
msgid "The Netdata service is not running."
msgstr "NetData服务未启动"
msgid "NetData Status"
msgstr "NetData服务状态"
msgid "Please enable the NetData service"
msgstr "请将NetData服务启用"
msgid "NetData"
msgstr "实时监控"
msgid "Set the netdata access port"
msgstr "设置访问端口"
msgid "Base Setting"
msgstr "基本设置"
msgid "Netdata is high-fidelity infrastructure monitoring and troubleshooting.Open-source, free, preconfigured, opinionated, and always real-time."
msgstr "Netdata是高保真的基础设施监控和故障排除。开源、免费、预配置、始终实时."
msgid "</br>For specific usage, see:"
msgstr "</br>具体使用方法参见:"

View File

@ -1 +0,0 @@
zh-cn

View File

@ -0,0 +1,32 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Running state"
msgstr "运行状态"
msgid "The Netdata service is running."
msgstr "NetData服务已启动"
msgid "The Netdata service is not running."
msgstr "NetData服务未启动"
msgid "NetData Status"
msgstr "NetData服务状态"
msgid "Please enable the NetData service"
msgstr "请将NetData服务启用"
msgid "NetData"
msgstr "实时监控"
msgid "Set the netdata access port"
msgstr "设置访问端口"
msgid "Base Setting"
msgstr "基本设置"
msgid "Netdata is high-fidelity infrastructure monitoring and troubleshooting.Open-source, free, preconfigured, opinionated, and always real-time."
msgstr "Netdata是高保真的基础设施监控和故障排除。开源、免费、预配置、始终实时."
msgid "</br>For specific usage, see:"
msgstr "</br>具体使用方法参见:"

View File

@ -0,0 +1,6 @@
config netdata 'netdata'
option logger '1'
option enabled '0'
option port '19990'

View File

@ -1,314 +0,0 @@
#
# apps.plugin process grouping
#
# The apps.plugin displays charts with information about the processes running.
# This config allows grouping processes together, so that several processes
# will be reported as one.
#
# Only groups in this file are reported. All other processes will be reported
# as 'other'.
#
# For each process given, its whole process tree will be grouped, not just
# the process matched. The plugin will include both parents and childs.
#
# The format is:
#
# group: process1 process2 process3 ...
#
# Each group can be given multiple times, to add more processes to it.
#
# The process names are the ones returned by:
#
# - ps -e or /proc/PID/stat
# - in case of substring mode (see below): /proc/PID/cmdline
#
# To add process names with spaces, enclose them in quotes (single or double)
# example: 'Plex Media Serv' "my other process".
#
# Wildcard support:
# You can add an asterisk (*) at the beginning and/or the end of a process:
#
# *name suffix mode: will search for processes ending with 'name'
# (/proc/PID/stat)
#
# name* prefix mode: will search for processes beginning with 'name'
# (/proc/PID/stat)
#
# *name* substring mode: will search for 'name' in the whole command line
# (/proc/PID/cmdline)
#
# If you enter even just one *name* (substring), apps.plugin will process
# /proc/PID/cmdline for all processes, just once (when they are first seen).
#
# To add processes with single quotes, enclose them in double quotes
# example: "process with this ' single quote"
#
# To add processes with double quotes, enclose them in single quotes:
# example: 'process with this " double quote'
#
# If a group or process name starts with a -, the dimension will be hidden
# (cpu chart only).
#
# If a process starts with a +, debugging will be enabled for it
# (debugging produces a lot of output - do not enable it in production systems)
#
# You can add any number of groups you like. Only the ones found running will
# affect the charts generated. However, producing charts with hundreds of
# dimensions may slow down your web browser.
#
# The order of the entries in this list is important: the first that matches
# a process is used, so put important ones at the top. Processes not matched
# by any row, will inherit it from their parents or children.
#
# The order also controls the order of the dimensions on the generated charts
# (although applications started after apps.plugin is started, will be appended
# to the existing list of dimensions the netdata daemon maintains).
# -----------------------------------------------------------------------------
# NETDATA processes accounting
# netdata main process
netdata: netdata
# netdata known plugins
# plugins not defined here will be accumulated in netdata, above
apps.plugin: apps.plugin
freeipmi.plugin: freeipmi.plugin
nfacct.plugin: nfacct.plugin
cups.plugin: cups.plugin
xenstat.plugin: xenstat.plugin
perf.plugin: perf.plugin
charts.d.plugin: *charts.d.plugin*
node.d.plugin: *node.d.plugin*
python.d.plugin: *python.d.plugin*
tc-qos-helper: *tc-qos-helper.sh*
fping: fping
ioping: ioping
go.d.plugin: *go.d.plugin*
slabinfo.plugin: slabinfo.plugin
ebpf.plugin: *ebpf.plugin*
# agent-service-discovery
agent_sd: agent_sd
# -----------------------------------------------------------------------------
# authentication/authorization related servers
auth: radius* openldap* ldap* slapd authelia
fail2ban: fail2ban*
# -----------------------------------------------------------------------------
# web/ftp servers
httpd: apache* httpd nginx* lighttpd hiawatha
proxy: squid* c-icap squidGuard varnish*
php: php* lsphp*
ftpd: proftpd in.tftpd vsftpd
uwsgi: uwsgi
unicorn: *unicorn*
puma: *puma*
# -----------------------------------------------------------------------------
# database servers
sql: mysqld* mariad* postgres* postmaster* oracle_* ora_* sqlservr
nosql: mongod redis* memcached *couchdb*
timedb: prometheus *carbon-cache.py* *carbon-aggregator.py* *graphite/manage.py* *net.opentsdb.tools.TSDMain* influxd*
columndb: clickhouse-server*
# -----------------------------------------------------------------------------
# email servers
email: dovecot imapd pop3d amavis* master zmstat* zmmailboxdmgr qmgr oqmgr saslauthd opendkim clamd freshclam tlsmgr postfwd2 postscreen postfix smtp* lmtp* sendmail
# -----------------------------------------------------------------------------
# network, routing, VPN
ppp: ppp*
vpn: openvpn pptp* cjdroute gvpe tincd
wifi: hostapd wpa_supplicant NetworkManager
routing: ospfd* ospf6d* bgpd bfdd fabricd isisd eigrpd sharpd staticd ripd ripngd pimd pbrd nhrpd ldpd zebra vrrpd vtysh bird*
modem: ModemManager
tor: tor
# -----------------------------------------------------------------------------
# high availability and balancers
camo: *camo*
balancer: ipvs_* haproxy
ha: corosync hs_logd ha_logd stonithd pacemakerd lrmd crmd
# -----------------------------------------------------------------------------
# telephony
pbx: asterisk safe_asterisk *vicidial*
sip: opensips* stund
# -----------------------------------------------------------------------------
# chat
chat: irssi *vines* *prosody* murmurd
# -----------------------------------------------------------------------------
# monitoring
logs: ulogd* syslog* rsyslog* logrotate systemd-journald rotatelogs
nms: snmpd vnstatd smokeping zabbix* monit munin* mon openhpid watchdog tailon nrpe
splunk: splunkd
azure: mdsd *waagent* *omiserver* *omiagent* hv_kvp_daemon hv_vss_daemon *auoms* *omsagent*
# -----------------------------------------------------------------------------
# storage, file systems and file servers
ceph: ceph-* ceph_* radosgw* rbd-* cephfs-* osdmaptool crushtool
samba: smbd nmbd winbindd ctdbd ctdb-* ctdb_*
nfs: rpcbind rpc.* nfs*
zfs: spl_* z_* txg_* zil_* arc_* l2arc*
btrfs: btrfs*
iscsi: iscsid iscsi_eh
# -----------------------------------------------------------------------------
# kubernetes
kubelet: kubelet
kube-dns: kube-dns
kube-proxy: kube-proxy
metrics-server: metrics-server
heapster: heapster
# -----------------------------------------------------------------------------
# containers & virtual machines
containers: lxc* docker* balena*
VMs: vbox* VBox* qemu*
# -----------------------------------------------------------------------------
# ssh servers and clients
ssh: ssh* scp dropbear
# -----------------------------------------------------------------------------
# print servers and clients
print: cups* lpd lpq
# -----------------------------------------------------------------------------
# time servers and clients
time: ntp* systemd-timesyn* chronyd
# -----------------------------------------------------------------------------
# dhcp servers and clients
dhcp: *dhcp*
# -----------------------------------------------------------------------------
# name servers and clients
dns: named unbound nsd pdns_server knotd gdnsd yadifad dnsmasq systemd-resolve*
dnsdist: dnsdist
# -----------------------------------------------------------------------------
# installation / compilation / debugging
build: cc1 cc1plus as gcc* cppcheck ld make cmake automake autoconf autoreconf
build: git gdb valgrind*
# -----------------------------------------------------------------------------
# antivirus
antivirus: clam* *clam imunify360*
# -----------------------------------------------------------------------------
# torrent clients
torrents: *deluge* transmission* *SickBeard* *CouchPotato* *rtorrent*
# -----------------------------------------------------------------------------
# backup servers and clients
backup: rsync lsyncd bacula* borg rclone
# -----------------------------------------------------------------------------
# cron
cron: cron* atd anacron systemd-cron*
# -----------------------------------------------------------------------------
# UPS
ups: upsmon upsd */nut/*
# -----------------------------------------------------------------------------
# media players, servers, clients
media: mplayer vlc xine mediatomb omxplayer* kodi* xbmc* mediacenter eventlircd
media: mpd minidlnad mt-daapd avahi* Plex* jellyfin squeeze* jackett Ombi
# -----------------------------------------------------------------------------
# java applications
hdfsdatanode: *org.apache.hadoop.hdfs.server.datanode.DataNode*
hdfsnamenode: *org.apache.hadoop.hdfs.server.namenode.NameNode*
hdfsjournalnode: *org.apache.hadoop.hdfs.qjournal.server.JournalNode*
hdfszkfc: *org.apache.hadoop.hdfs.tools.DFSZKFailoverController*
yarnnode: *org.apache.hadoop.yarn.server.nodemanager.NodeManager*
yarnmgr: *org.apache.hadoop.yarn.server.resourcemanager.ResourceManager*
yarnproxy: *org.apache.hadoop.yarn.server.webproxy.WebAppProxyServer*
sparkworker: *org.apache.spark.deploy.worker.Worker*
sparkmaster: *org.apache.spark.deploy.master.Master*
hbaseregion: *org.apache.hadoop.hbase.regionserver.HRegionServer*
hbaserest: *org.apache.hadoop.hbase.rest.RESTServer*
hbasethrift: *org.apache.hadoop.hbase.thrift.ThriftServer*
hbasemaster: *org.apache.hadoop.hbase.master.HMaster*
zookeeper: *org.apache.zookeeper.server.quorum.QuorumPeerMain*
hive2: *org.apache.hive.service.server.HiveServer2*
hivemetastore: *org.apache.hadoop.hive.metastore.HiveMetaStore*
solr: *solr.install.dir*
airflow: *airflow*
# -----------------------------------------------------------------------------
# X
X: X Xorg xinit lightdm xdm pulseaudio gkrellm xfwm4 xfdesktop xfce* Thunar
X: xfsettingsd xfconfd gnome-* gdm gconf* dconf* xfconf* *gvfs gvfs* slim
X: kdeinit* kdm plasmashell
X: evolution-* firefox chromium opera vivaldi-bin epiphany WebKit*
X: '*systemd --user*' chrome *chrome-sandbox* *google-chrome* *chromium* *firefox*
# -----------------------------------------------------------------------------
# Kernel / System
ksmd: ksmd
system: systemd-* udisks* udevd* *udevd connmand ipv6_addrconf dbus-* rtkit*
system: inetd xinetd mdadm polkitd acpid uuidd packagekitd upowerd colord
system: accounts-daemon rngd haveged
kernel: kthreadd kauditd lockd khelper kdevtmpfs khungtaskd rpciod
kernel: fsnotify_mark kthrotld deferwq scsi_*
# -----------------------------------------------------------------------------
# other application servers
kafka: *kafka.Kafka*
rabbitmq: *rabbitmq*
sidekiq: *sidekiq*
java: java
ipfs: ipfs
node: node*
factorio: factorio
p4: p4*
git-services: gitea gitlab-runner

View File

@ -1,7 +0,0 @@
[global]
ebpf load mode = entry
disable apps = no
[ebpf programs]
process = yes
network viewer = yes

View File

@ -1,88 +0,0 @@
[exporting:global]
enabled = no
# send configured labels = yes
# send automatic labels = no
# update every = 10
[prometheus:exporter]
# send names instead of ids = yes
# send configured labels = yes
# send automatic labels = no
# send charts matching = *
# send hosts matching = localhost *
# prefix = netdata
# An example configuration for graphite, json, opentsdb exporting connectors
# [graphite:my_graphite_instance]
# enabled = no
# destination = localhost
# data source = average
# prefix = netdata
# hostname = my_hostname
# update every = 10
# buffer on failures = 10
# timeout ms = 20000
# send names instead of ids = yes
# send charts matching = *
# send hosts matching = localhost *
# [prometheus_remote_write:my_prometheus_remote_write_instance]
# enabled = no
# destination = localhost
# remote write URL path = /receive
# data source = average
# prefix = netdata
# hostname = my_hostname
# update every = 10
# buffer on failures = 10
# timeout ms = 20000
# send names instead of ids = yes
# send charts matching = *
# send hosts matching = localhost *
# [kinesis:my_kinesis_instance]
# enabled = no
# destination = us-east-1
# stream name = netdata
# aws_access_key_id = my_access_key_id
# aws_secret_access_key = my_aws_secret_access_key
# data source = average
# prefix = netdata
# hostname = my_hostname
# update every = 10
# buffer on failures = 10
# timeout ms = 20000
# send names instead of ids = yes
# send charts matching = *
# send hosts matching = localhost *
# [pubsub:my_pubsub_instance]
# enabled = no
# destination = pubsub.googleapis.com
# credentials file = /etc/netdata/pubsub_credentials.json
# project id = my_project
# topic id = my_topic
# data source = average
# prefix = netdata
# hostname = my_hostname
# update every = 10
# buffer on failures = 10
# timeout ms = 20000
# send names instead of ids = yes
# send charts matching = *
# send hosts matching = localhost *
# [mongodb:my_mongodb_instance]
# enabled = no
# destination = localhost
# database = my_database
# collection = my_collection
# data source = average
# prefix = netdata
# hostname = my_hostname
# update every = 10
# buffer on failures = 10
# timeout ms = 20000
# send names instead of ids = yes
# send charts matching = *
# send hosts matching = localhost *

View File

@ -1,32 +0,0 @@
# Full configuration can be retrieved from the running
# server at http://localhost:19999/netdata.conf
#
# Example:
# curl -o /etc/netdata/netdata.conf http://localhost:19999/netdata.conf
#
[global]
update every = 2
memory deduplication (ksm) = no
debug log = syslog
error log = syslog
access log = none
run as user = root
[web]
allow connections from = * localhost 10.* 192.168.* 172.16.* 172.17.* 172.18.* 172.19.* 172.20.* 172.21.* 172.22.* 172.23.* 172.24.* 172.25.* 172.26.* 172.27.* 172.28.* 172.29.* 172.30.* 172.31.*
allow dashboard from = * localhost 10.* 192.168.* 172.16.* 172.17.* 172.18.* 172.19.* 172.20.* 172.21.* 172.22.* 172.23.* 172.24.* 172.25.* 172.26.* 172.27.* 172.28.* 172.29.* 172.30.* 172.31.*
[plugins]
cgroups = no
apps = no
charts.d = no
fping = no
node.d = no
python.d = no
[health]
enabled = no
[plugin:proc:ipc]
shared memory totals = no

View File

@ -1,205 +0,0 @@
# netdata configuration for aggregating data from remote hosts
#
# API keys authorize a pair of sending-receiving netdata servers.
# Once their communication is authorized, they can exchange metrics for any
# number of hosts.
#
# You can generate API keys, with the linux command: uuidgen
# -----------------------------------------------------------------------------
# 1. ON CHILD NETDATA - THE ONE THAT WILL BE SENDING METRICS
[stream]
# Enable this on child nodes, to have them send metrics.
enabled = no
# Where is the receiving netdata?
# A space separated list of:
#
# [PROTOCOL:]HOST[%INTERFACE][:PORT][:SSL]
#
# If many are given, the first available will get the metrics.
#
# PROTOCOL = tcp, udp, or unix (only tcp and unix are supported by parent nodes)
# HOST = an IPv4, IPv6 IP, or a hostname, or a unix domain socket path.
# IPv6 IPs should be given with brackets [ip:address]
# INTERFACE = the network interface to use (only for IPv6)
# PORT = the port number or service name (/etc/services)
# SSL = when this word appear at the end of the destination string
# the Netdata will encrypt the connection with the parent.
#
# This communication is not HTTP (it cannot be proxied by web proxies).
destination =
# Skip Certificate verification?
#
# The netdata child is configurated to avoid invalid SSL/TLS certificate,
# so certificates that are self-signed or expired will stop the streaming.
# Case the server certificate is not valid, you can enable the use of
# 'bad' certificates setting the next option as 'yes'.
#
#ssl skip certificate verification = yes
# Certificate Authority Path
#
# OpenSSL has a default directory where the known certificates are stored,
# case it is necessary it is possible to change this rule using the variable
# "CApath"
#
#CApath = /etc/ssl/certs/
# Certificate Authority file
#
# When the Netdata parent has certificate, that is not recognized as valid,
# we can add this certificate in the list of known certificates in CApath
# and give for Netdata as argument.
#
#CAfile = /etc/ssl/certs/cert.pem
# The API_KEY to use (as the sender)
api key =
# The timeout to connect and send metrics
timeout seconds = 60
# If the destination line above does not specify a port, use this
default port = 19999
# filter the charts to be streamed
# netdata SIMPLE PATTERN:
# - space separated list of patterns (use \ to include spaces in patterns)
# - use * as wildcard, any number of times within each pattern
# - prefix a pattern with ! for a negative match (ie not stream the charts it matches)
# - the order of patterns is important (left to right)
# To send all except a few, use: !this !that * (ie append a wildcard pattern)
send charts matching = *
# The buffer to use for sending metrics.
# 1MB is good for 10-20 seconds of data, so increase this if you expect latencies.
# The buffer is flushed on reconnects (this will not prevent gaps at the charts).
buffer size bytes = 1048576
# If the connection fails, or it disconnects,
# retry after that many seconds.
reconnect delay seconds = 5
# Sync the clock of the charts for that many iterations, when starting.
initial clock resync iterations = 60
# -----------------------------------------------------------------------------
# 2. ON PARENT NETDATA - THE ONE THAT WILL BE RECEIVING METRICS
# You can have one API key per child,
# or the same API key for all child nodes.
#
# netdata searches for options in this order:
#
# a) parent netdata settings (netdata.conf)
# b) [stream] section (above)
# c) [API_KEY] section (below, settings for the API key)
# d) [MACHINE_GUID] section (below, settings for each machine)
#
# You can combine the above (the more specific setting will be used).
# API key authentication
# If the key is not listed here, it will not be able to push metrics.
# [API_KEY] is [YOUR-API-KEY], i.e [11111111-2222-3333-4444-555555555555]
[API_KEY]
# Default settings for this API key
# You can disable the API key, by setting this to: no
# The default (for unknown API keys) is: no
enabled = no
# A list of simple patterns matching the IPs of the servers that
# will be pushing metrics using this API key.
# The metrics are received via the API port, so the same IPs
# should also be matched at netdata.conf [web].allow connections from
allow from = *
# The default history in entries, for all hosts using this API key.
# You can also set it per host below.
# If you don't set it here, the history size of the central netdata
# will be used.
default history = 3600
# The default memory mode to be used for all hosts using this API key.
# You can also set it per host below.
# If you don't set it here, the memory mode of netdata.conf will be used.
# Valid modes:
# save save on exit, load on start
# map like swap (continuously syncing to disks - you need SSD)
# ram keep it in RAM, don't touch the disk
# none no database at all (use this on headless proxies)
# dbengine like a traditional database
default memory mode = ram
# Shall we enable health monitoring for the hosts using this API key?
# 3 possible values:
# yes enable alarms
# no do not enable alarms
# auto enable alarms, only when the sending netdata is connected. For ephemeral child nodes or child system restarts,
# ensure that the netdata process on the child is gracefully stopped, to prevent invalid last_collected alarms
# You can also set it per host, below.
# The default is taken from [health].enabled of netdata.conf
health enabled by default = auto
# postpone alarms for a short period after the sender is connected
default postpone alarms on connect seconds = 60
# need to route metrics differently? set these.
# the defaults are the ones at the [stream] section (above)
#default proxy enabled = yes | no
#default proxy destination = IP:PORT IP:PORT ...
#default proxy api key = API_KEY
#default proxy send charts matching = *
# -----------------------------------------------------------------------------
# 3. PER SENDING HOST SETTINGS, ON PARENT NETDATA
# THIS IS OPTIONAL - YOU DON'T HAVE TO CONFIGURE IT
# This section exists to give you finer control of the parent settings for each
# child host, when the same API key is used by many netdata child nodes / proxies.
#
# Each netdata has a unique GUID - generated the first time netdata starts.
# You can find it at /var/lib/netdata/registry/netdata.public.unique.id
# (at the child).
#
# The host sending data will have one. If the host is not ephemeral,
# you can give settings for each sending host here.
[MACHINE_GUID]
# enable this host: yes | no
# When disabled, the parent will not receive metrics for this host.
# THIS IS NOT A SECURITY MECHANISM - AN ATTACKER CAN SET ANY OTHER GUID.
# Use only the API key for security.
enabled = no
# A list of simple patterns matching the IPs of the servers that
# will be pushing metrics using this MACHINE GUID.
# The metrics are received via the API port, so the same IPs
# should also be matched at netdata.conf [web].allow connections from
# and at stream.conf [API_KEY].allow from
allow from = *
# The number of entries in the database
history = 3600
# The memory mode of the database: save | map | ram | none | dbengine
memory mode = save
# Health / alarms control: yes | no | auto
health enabled = yes
# postpone alarms when the sender connects
postpone alarms on connect seconds = 60
# need to route metrics differently?
# the defaults are the ones at the [API KEY] section
#proxy enabled = yes | no
#proxy destination = IP:PORT IP:PORT ...
#proxy api key = API_KEY
#proxy send charts matching = *

View File

@ -1,8 +1,11 @@
#!/bin/sh
[ -f /usr/share/netdata/webcn/netdata.conf ] && mv -f /usr/share/netdata/webcn/netdata.conf /etc/netdata/netdata.conf
[ -f /usr/share/netdata/webcn/netdata ] && mv -f /usr/share/netdata/webcn/netdata /etc/config/netdata
[ -f /usr/share/netdata/webcn/dashboard.js ] && mv -f /usr/share/netdata/webcn/dashboard.js /usr/share/netdata/web/dashboard.js
[ -f /usr/share/netdata/webcn/dashboard_info.js ] && mv -f /usr/share/netdata/webcn/dashboard_info.js /usr/share/netdata/web/dashboard_info.js
[ -f /usr/share/netdata/webcn/main.js ] && mv -f /usr/share/netdata/webcn/main.js /usr/share/netdata/web/main.js
[ -f /usr/share/netdata/webcn/index.html ] && mv -f /usr/share/netdata/webcn/index.html /usr/share/netdata/web/index.html
[ -f /usr/share/netdata/webcn/netdata.init ] && mv -f /usr/share/netdata/webcn/netdata.init /etc/init.d/netdata
rm -rf /tmp/luci-modulecache /tmp/luci-indexcache*
chmod +x /etc/init.d/netdata
exit 0

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// 时间 By Jason
// DO NOT EDIT: This file is automatically generated from the source files in src/
// ----------------------------------------------------------------------------
@ -142,18 +142,18 @@ NETDATA.zeropad = function (x) {
NETDATA.seconds4human = function (seconds, options) {
let defaultOptions = {
now: '现在',
now: 'now',
space: ' ',
negative_suffix: '',
day: '',
days: '',
hour: '小时',
hours: '小时',
minute: '分钟',
minutes: '分钟',
second: '',
seconds: '',
and: ''
negative_suffix: 'ago',
day: 'day',
days: 'days',
hour: 'hour',
hours: 'hours',
minute: 'min',
minutes: 'mins',
second: 'sec',
seconds: 'secs',
and: 'and'
};
if (typeof options !== 'object') {

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
// Main JavaScript file for the Netdata GUI.
// 翻译 By Jason
// Codacy declarations
/* global NETDATA */
@ -1511,7 +1511,7 @@ function headMain(os, charts, duration) {
if (typeof charts['system.io'] !== 'undefined') {
head += '<div class="netdata-container" style="margin-right: 10px;" data-netdata="system.io"'
+ ' data-dimensions="in"'
+ ' data-chart-library="easypiechart""'
+ ' data-chart-library="easypiechart"'
+ ' data-title="磁碟读取"'
+ ' data-width="11%"'
+ ' data-before="0"'
@ -1831,12 +1831,10 @@ function renderPage(menus, data) {
data.alarms_count.toLocaleString() + '</strong> 警报.';
if (!isMemoryModeDbEngine) {
sidebar += '<br />&nbsp;<br />获取更多历史记录 ' +
'<a href="https://learn.netdata.cloud/guides/longer-metrics-storage#using-the-round-robin-database" target=_blank>配置Netdata\'s <strong>历史</strong></a> 或使用 <a href="https://learn.netdata.cloud/docs/agent/database/engine/" target=_blank>DB 引擎.</a>';
sidebar += '<br />&nbsp;<br />获取更多历史记录 ';
}
sidebar += '<br/>&nbsp;<br/><strong>netdata</strong><br/>' + data.version.toString() + '</small></li>';
sidebar += '</ul>';
div.innerHTML = html;
document.getElementById('sidebar').innerHTML = sidebar;
@ -2039,7 +2037,7 @@ function clipboardCopyBadgeEmbed(url) {
function alarmsUpdateModal() {
var active = '<h3>触发警报</h3><table class="table">';
var all = '<h3>所有作用中的警报</h3><div class="panel-group" id="alarms_all_accordion" role="tablist" aria-multiselectable="true">';
var footer = '<hr/><a href="https://github.com/netdata/netdata/tree/master/web/api/badges#netdata-badges" target="_blank">netdata badges</a> 会自动重新整理。不同颜色分表代表的警报状态: <span style="color: #e05d44"><b>&nbsp;红色&nbsp;</b></span> 表示重大, <span style="color:#fe7d37"><b>&nbsp;橘色&nbsp;</b></span> 表示警告, <span style="color: #4c1"><b>&nbsp;绿色&nbsp;</b></span> 表示良好, <span style="color: #9f9f9f"><b>&nbsp;灰色&nbsp;</b></span> 表示未定义 (例如无资料或无状态), <span style="color: #000"><b>&nbsp;黑色&nbsp;</b></span> 表示尚未初始化。您可以复制这里的网址并将它们嵌入到任一个网页。<br/>netdata 能够发送这些警报通知。请参阅 <a href="https://github.com/netdata/netdata/blob/master/health/notifications/health_alarm_notify.conf" target="_blank">这个设定档</a> 了解更多资讯。';
var footer = '<hr/><a href="https://github.com/netdata/netdata/tree/master/web/api/badges#netdata-badges" target="_blank">netdata badges</a> 会自动重新整理。不同颜色分表代表的警报状态:<span style="color: #e05d44"><b>&nbsp;红色&nbsp;</b></span> 表示重大<span style="color:#fe7d37"><b>&nbsp;橘色&nbsp;</b></span> 表示警告<span style="color: #4c1"><b>&nbsp;绿色&nbsp;</b></span> 表示良好<span style="color: #9f9f9f"><b>&nbsp;灰色&nbsp;</b></span> 表示未定义 (例如无资料或无状态)<span style="color: #000"><b>&nbsp;黑色&nbsp;</b></span> 表示尚未初始化。您可以复制这里的网址并将它们嵌入到任一个网页。<br/>netdata 能够发送这些警报通知。请参阅 <a href="https://github.com/netdata/netdata/blob/master/health/notifications/health_alarm_notify.conf">这个设定档</a> 了解更多资讯。';
loadClipboard(function () {
});
@ -2316,7 +2314,7 @@ function alarmsUpdateModal() {
all += "</div>";
if (!count_active) {
active += '<div style="width:100%; height: 100px; text-align: center;"><span style="font-size: 50px;"><i class="fas fa-thumbs-up"></i></span><br/>一切正常。没有警报。</div>';
active += '<div style="width:100%; height: 100px; text-align: center;"><span style="font-size: 50px;"><i class="fas fa-thumbs-up"></i></span><br/>Everything is normal. No raised alarms.</div>';
} else {
active += footer;
}
@ -2575,7 +2573,7 @@ function alarmsUpdateModal() {
},
{
field: 'duration',
title: 'Last Duration',
title: '上次持续时间',
titleTooltip: 'The duration the alarm was at its previous state, just before this event',
formatter: function (value, row, index) {
void (row);
@ -2589,7 +2587,7 @@ function alarmsUpdateModal() {
},
{
field: 'non_clear_duration',
title: 'Raised Duration',
title: '提升的持续时间',
titleTooltip: 'The duration the alarm was raised, just before this event',
formatter: function (value, row, index) {
void (row);
@ -2603,7 +2601,7 @@ function alarmsUpdateModal() {
},
{
field: 'recipient',
title: 'Recipient',
title: '收件人',
titleTooltip: 'The recipient of this event',
align: 'center',
valign: 'middle',
@ -2612,7 +2610,7 @@ function alarmsUpdateModal() {
},
{
field: 'processed',
title: 'Processed Status',
title: '已处理状态',
titleTooltip: 'True when this event is processed',
formatter: function (value, row, index) {
void (row);
@ -2631,7 +2629,7 @@ function alarmsUpdateModal() {
},
{
field: 'updated',
title: 'Updated Status',
title: '更新的状态',
titleTooltip: 'True when this event has been updated by another event',
formatter: function (value, row, index) {
void (row);
@ -2650,7 +2648,7 @@ function alarmsUpdateModal() {
},
{
field: 'updated_by_id',
title: 'Updated By ID',
title: '由ID更新',
titleTooltip: 'The unique ID of the event that obsoleted this one',
formatter: function (value, row, index) {
void (row);
@ -2664,7 +2662,7 @@ function alarmsUpdateModal() {
},
{
field: 'updates_id',
title: 'Updates ID',
title: '更新ID',
titleTooltip: 'The unique ID of the event obsoleted because of this event',
formatter: function (value, row, index) {
void (row);
@ -2678,7 +2676,7 @@ function alarmsUpdateModal() {
},
{
field: 'exec',
title: 'Script',
title: '脚本',
titleTooltip: 'The script to handle the event notification',
align: 'center',
valign: 'middle',
@ -2687,7 +2685,7 @@ function alarmsUpdateModal() {
},
{
field: 'exec_run',
title: 'Script Run At',
title: '脚本运行时间',
titleTooltip: 'The date and time the script has been ran',
formatter: function (value, row, index) {
void (row);
@ -2701,7 +2699,7 @@ function alarmsUpdateModal() {
},
{
field: 'exec_code',
title: 'Script Return Value',
title: '脚本返回值',
titleTooltip: 'The return code of the script',
formatter: function (value, row, index) {
void (row);
@ -2720,7 +2718,7 @@ function alarmsUpdateModal() {
},
{
field: 'delay',
title: 'Script Delay',
title: '脚本延迟',
titleTooltip: 'The hysteresis of the notification',
formatter: function (value, row, index) {
void (row);
@ -2735,7 +2733,7 @@ function alarmsUpdateModal() {
},
{
field: 'delay_up_to_timestamp',
title: 'Script Delay Run At',
title: '脚本延迟运行时间',
titleTooltip: 'The date and time the script should be run, after hysteresis',
formatter: function (value, row, index) {
void (row);
@ -2749,7 +2747,7 @@ function alarmsUpdateModal() {
},
{
field: 'info',
title: '说明',
title: '描述',
titleTooltip: 'A short description of the alarm',
align: 'center',
valign: 'middle',
@ -2758,7 +2756,7 @@ function alarmsUpdateModal() {
},
{
field: 'source',
title: '警报来源',
title: '报警源',
titleTooltip: 'The source of configuration of the alarm',
align: 'center',
valign: 'middle',
@ -2974,7 +2972,7 @@ function getGithubLatestVersion(callback) {
callback(data);
})
.fail(function () {
versionLog('从 github 下载最新版本 ID 失败');
versionLog('从 github 下载最新版本 ID 失败');
callback(null);
});
}
@ -3047,19 +3045,10 @@ function notifyForUpdate(force) {
if (sha1 === null) {
save = false;
versionLog('<p><big>取得您的 netdata 版本失败!</big></p><p>You can always get the latest netdata from <a href="https://github.com/netdata/netdata" target="_blank">its github page</a>.</p>');
} else if (sha2 === null) {
save = false;
versionLog('<p><big>从 github 取得 netdata 最新版本失败。</big></p><p>您也可以从 <a href="https://github.com/netdata/netdata" target="_blank">its github page</a> 取得最新 netdata 版本。</p>');
} else if (versionsMatch(sha1, sha2)) {
versionLog('<p><big>取得您的 netdata 版本失败!</big></p>');
else {
save = true;
versionLog('<p><big>您已经是最新版本的 netdata</big></p><p>还没有更新?<br/>或许,我们还需要一些动力继续前进!</p><p>如果您还没有做好更新的准备,请您 <a href="https://github.com/netdata/netdata" target="_blank">到 github 给 netdata <b><i class="fas fa-star"></i></b> at its github page</a>.</p>');
} else {
save = true;
var compare = 'https://learn.netdata.cloud/docs/agent/changelog/';
versionLog('<p><big><strong>New version of netdata available!</strong></big></p><p>Latest version: <b><code>' + sha2 + '</code></b></p><p><a href="' + compare + '" target="_blank">Click here for the changes log</a> and<br/><a href="https://github.com/netdata/netdata/tree/master/packaging/installer/UPDATE.md" target="_blank">click here for directions on updating</a> your netdata installation.</p><p>We suggest to review the changes log for new features you may be interested, or important bug fixes you may need.<br/>Keeping your netdata updated is generally a good idea.</p>');
document.getElementById('update_badge').innerHTML = '!';
versionLog('<p><big>您已经是最新版本的 netdata</big></p>');
}
if (save) {
@ -4264,7 +4253,6 @@ function runOnceOnDashboardWithjQuery() {
versionLog('checking, please wait...');
})
.on('shown.bs.modal', function () {
notifyForUpdate(true);
});
// ------------------------------------------------------------------------
@ -4484,7 +4472,6 @@ function finalizePage() {
ga('send', 'pageview', '/demosite/' + window.location.host);
}, 2000);
} else {
notifyForUpdate();
}
if (urlOptions.show_alarms === true) {

View File

@ -0,0 +1,6 @@
config netdata 'netdata'
option logger '1'
option enabled '0'
option port '19990'

View File

@ -0,0 +1,52 @@
# Full configuration can be retrieved from the running
# server at http://localhost:19999/netdata.conf
#
# Example:
# curl -o /etc/netdata/netdata.conf http://localhost:19999/netdata.conf
#
[global]
update every = 2
memory deduplication (ksm) = no
debug log = syslog
error log = syslog
access log = none
run as user = root
[web]
allow connections from = *
allow dashboard from = *
[plugins]
cgroups = no
apps = no
charts.d = no
fping = no
node.d = no
python.d = no
[plugin:proc]
ipc =no
/proc/sysvipc/shm = no
/sys/devices/system/edac/mc = no
/sys/devices/system/node = no
/proc/net/sockstat = no
/proc/net/netstat = no
/proc/net/snmp = no
/proc/net/softnet_stat = no
/proc/net/sctp/snmp = no
/proc/net/ip_vs/stats = no
/proc/net/stat/synproxy = no
/sys/kernel/mm/ksm = no
/dev/mapper = no
semaphore totals = no
[plugin:proc:/proc/diskstats]
path to /dev/vx/dsk =
path to /dev/disk/by-label =</font>
[health]
enabled = no
[plugin:proc:ipc]
shared memory totals = no

View File

@ -0,0 +1,46 @@
#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
APPBINARY=/usr/sbin/netdata
CONFIGFILE=/etc/netdata/netdata.conf
get_config() {
config_get_bool enabled $1 enabled 1
config_get_bool logger $1 logger 1
config_get port $1 port 19999
}
netdata_prepare() {
pgrep -f /usr/sbin/netdata | xargs kill -9 >/dev/null 2>&1
logger -t netdata -p warn "netdata is stop."
}
stop_service() {
netdata_prepare
}
start_service() {
netdata_prepare
config_load netdata
config_foreach get_config netdata
[ x$enabled == x1 ] || return 1
mkdir -m 0755 -p /var/cache/netdata
logger -t netdata -p warn "netdata is start."
chown nobody /var/cache/netdata
mkdir -m 0755 -p /var/lib/netdata
chown nobody /var/lib/netdata
mkdir -m 0755 -p /var/log/netdata
chown nobody /var/log/netdata
procd_open_instance
procd_set_param command $APPBINARY -D -c $CONFIGFILE -p $port:$port
[ "x$logger" == x1 ] && procd_set_param stderr 1
procd_set_param file $CONFIGFILE
procd_set_param respawn
procd_close_instance
}
service_triggers() {
procd_add_reload_trigger "netdata"
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff