applications/luci-statistics: Add ping interval option, closes #136
[project/luci.git] / applications / luci-statistics / luasrc / model / cbi / luci_statistics / ping.lua
1 --[[
2
3 Luci configuration model for statistics - collectd ping plugin configuration
4 (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13
14 ]]--
15
16 m = Map("luci_statistics",
17         translate("Ping Plugin Configuration"),
18         translate(
19                 "The ping plugin will send icmp echo replies to selected " ..
20                 "hosts and measure the roundtrip time for each host."
21         ))
22
23 -- collectd_ping config section
24 s = m:section( NamedSection, "collectd_ping", "luci_statistics" )
25
26 -- collectd_ping.enable
27 enable = s:option( Flag, "enable", translate("Enable this plugin") )
28 enable.default = 0
29
30 -- collectd_ping.hosts (Host)
31 hosts = s:option( Value, "Hosts", translate("Monitor hosts"), translate ("Add multiple hosts separated by space."))
32 hosts.default = "127.0.0.1"
33 hosts:depends( "enable", 1 )
34
35 -- collectd_ping.ttl (TTL)
36 ttl = s:option( Value, "TTL", translate("TTL for ping packets") )
37 ttl.isinteger = true
38 ttl.default   = 128
39 ttl:depends( "enable", 1 )
40
41 -- collectd_ping.interval (Interval)
42 interval = s:option( Value, "Interval", translate("Interval for pings"), translate ("Seconds") )
43 interval.isinteger = true
44 interval.default   = 30
45 interval:depends( "enable", 1 )
46
47 return m