defaults.py 2.84 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#!/usr/bin/env python
#
# ULG - Universal Looking Glass
# by Tomas Hlavacek (tomas.hlavacek@nic.cz)
# last udate: June 21 2012
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# HTML presentation settings
header = 'Universal looking glass test header'
refresh_interval = 5                             # interval of html refresh
usage_limit = 1                                  # maximum concurrently processed requests
24
range_step = 100                                 # number of table lines in the decorated output per page
25 26

# Settings defaults
27
always_start_thread = True # True is highly recommended
28
debug = False
29
rescan_on_display = False
30 31 32 33
persistent_storage_file = '/tmp/ulg.data'
session_dir = '/tmp'
usage_counter_file = '/tmp/ulg.lock'
log_file = '/tmp/ulg.log'
34
default_bird_sock = '/var/run/bird.ctl'
35
default_bird_sock_timeout = 30
36 37 38 39

# Template dir relative to the index.py script
template_dir = 'templates'
index_template_file = 'index.html'
40
table_decorator_template_file = 'tabledecorator.html'
41 42 43 44 45

# Paths to external programs
bin_ssh = '/usr/bin/ssh'

# Output (localized) strings
46 47 48 49 50 51
STRING_ANY='any'
STRING_PARAMETER='Parameter'
STRING_COMMAND='Command'
STRING_ERROR_COMMANDRUN='Error encountered while preparing or running command'
STRING_BAD_PARAMS='Verification of command or parameters failed.'
STRING_SESSION_OVERLIMIT = "<em>Limit of maximum concurrently running sessions and/or queries has been reached. The command can not be executed now. Please try again later.</em>"
52
STRING_ARBITRARY_ERROR = "Error encountered. Operation aborted. See log for further details."
53 54
STRING_IPADDRESS = "IP address"
STRING_IPSUBNET = "IP subnet"
55 56 57
STRING_MACADDRESS = "MAC address"
STRING_NONEORINTORIPADDRESS = "None or Interface or IP address"
STRING_INTERFACE = "Interface"
58
STRING_SOCKET_TIMEOUT = "Socket communication timed out. See log."
59
STRING_PEERID = "Peer ID"
60
STRING_RTABLE = "Routing Table"
61 62 63

# URL generator functions
def getASNURL(asn):
64 65 66 67
    return 'https://apps.db.ripe.net/search/query.html?searchtext=AS%s&flags=C&sources=&grssources=RIPE;AFRINIC;APNIC;ARIN;LACNIC;JPIRR;RADB&inverse=&types=AUT_NUM' % asn

def getIPPrefixURL(prefix):
    return 'https://apps.db.ripe.net/search/query.html?searchtext=%s&flags=C&sources=&grssources=RIPE;AFRINIC;APNIC;ARIN;LACNIC;JPIRR;RADB&inverse=&types=INET6NUM;INETNUM' % prefix