# -- Begin Configurable items ------------------------------------------------------#

# SECTION DIRECTORIES

# The Basedir is the full path to the npulse data area. This directory will
# be used to store all of the information about each of the monitored sites.
$Basedir          = ".";

# The Configdir is the location of all of the config and preference files.
$Configdir        = ".";

# The Vardir is the location of all of the run-time (/var) files.
$Vardir           = ".";

# The Htmldir is the full path to the Web Site 'document' directory of this
# machine. All of the HTML generated pages and images will be placed in
# this directory. The URL prefix for HTML files is typically null.
$Htmldir          = ".";
$Htmlprefix       = "";

# The Cgidir is the full path to the Web Site 'CGI' of this
# machine. All of the Perl code should be placed in
# this directory. The URL prefix for CGI files is typically null.
$Cgidir          = $Htmldir;
$Cgiurl          = "";

# The Libdir is the location of all of the config and preference files.
$Libdir        = $Cgidir."/lib";

# The Scriptdir is the location of all of the admin-defined Scripts.
$Scriptdir     = $Htmldir.'/scripts';

# SECTION COMMANDS

# If your 'nmap' command and traceroute commands are different from these,
# enter the appropriate values.
$Nmapcmd          = "nmap";
$Traceroutecmd    = "traceroute";

# sub DefDetailCmds

# SECTION HTML

# This parameter controls the HTML screen refresh rate. The rate is in seconds.
# Set the value to zero (0) to disable the screen refresh.
# Note that not all browsers support this feature.
$HtmlRefresh = 300;

# This is the http prefix string for your system.
$HTTP = "";

# This value defines the default sorting method for displaying the
# 'Basic', 'Compact', and 'List' pages. Values are defined by the keys in
# the $Templatetext variable in the 'preferences.pl' file 
# (with 'name' as an additional value).
$DefaultSort = "ip";

# This value affects the display of the individual ports in List mode.
# 1 = Display service names (if known); 2 = Display port numbers only;
# 3 = Display service name and port number. The default is 1.
$ListStyle = 1;

# These parameters affect how the information is displayed on
# the HTML pages.
$Basiccols        = 10;
$Fullcols         = 4;
$Color_ok         = "#009900";
$Color_warn       = "#e7e700";
$Color_fail       = "#990000";
$Text_ok          = "#FFFFFF";
$Text_warn        = "#330000";
$Text_fail        = "#FFFFFF";

# Font size parameters, because different browsers work differently!
# Each size is in points.
$Fontsize_normal  = 12;
$Fontsize_xsmall  = int($Fontsize_normal * 0.7 + 0.5);
$Fontsize_small   = int($Fontsize_normal * 0.8 + 0.5);
$Fontsize_large   = int($Fontsize_normal * 1.2 + 0.5);
$Fontsize_huge    = int($Fontsize_normal * 2);

# SECTION CONFIGURATION

# Send site failure and recovery information to this email address.
$Email = "";

# To display the customer contact information set this value to one (1);
# otherwise set it to zero (0).
$DisplayCustInfo = 1;

# To use names (or aliases) instead of IP address numbers, set this value
# to one (1); otherwise set it to zero (0).
$UseAliases = 0;

# If $UseAliases = 1 then you can set this value to control how the name or
# alias is displayed. (-1) Use full name. (0) = Use full name or (if defined) use alias.
# (1) = Strip ending portion of name (ie, .com). (2) = Strip last two portions of name (ie, .horsburgh.com)
# (3 .. 8) = Strip last X portions of name. (9) = Strip first and last portion only
# (ie., 'www.horsburgh.com' becomes 'horsburgh')
$CustomName = 0;

# If you want to keep historical data, set Keephistory to one (1);
# otherwise set it to zero (0). Maxhistorytime is the number of
# days to keep the history records. PortHistory will
# display the service/port history graphs. Set PortHistory to
# zero (0) to disable the feature, otherwise set it to the number
# of columns to display the graphs.
$Keephistory      = 1;
$Maxhistorytime   = 10;
$PortHistory      = 3;

# MaxEvents is the maximum number of events to display in the Event Log.
# Set MaxEvents to zero (0) to turn off the event log display.
# MaxEventLogSize is the maximum number of events to store in the Event Log file.
# EventSeverity controls what types of events are displayed. To display all events
# set EventSeverity to zero (0), for all non-auto message events
# set EventSeverity to one (1), for warnings and failures only set it to two (2),
# for failures only set it to three (3).
# Events4Users is a flag to control whether users (non admin) can see the event log.
# Set it to zero (0) to disable viewing by users, set it to one (1) to enable viewing.
$MaxEvents = 10;
$MaxEventLogSize = 1000;
$EventSeverity = 0;
$Events4Users = 0;

# This is the name of the program.
$Myname = "nPulse";

# SECTION TIMING

# This parameter affects the operation of the automatic 'recheck' processing.
# Autointerval is the monitoring interval in minutes. (Actually it is the
# amount of time that the process sleeps between runs!)
$Autointerval = 20;

# This parameter controls the number of seconds until a manual RECHECK causes
# a timeout error condition.
$RecheckTimeout = 240;

# CmdTimer controls when a user command (from the Detail Page) will timeout.
# This value is in seconds. The default value is 180 seconds (3 minutes).
# The minimum value is 10 seconds.
$CmdTimer = 180;

# PingTimeout controls the amount of time to wait for a ping (ICMP) response
# before giving up. The default value is 3 seconds. 
# The minimum value is 2 seconds.
$PingTimeout = 3;

# ScriptTimeout controls the amount of time to wait for each command in a
# port/service script to timeout. The default value is 10 seconds. The
# minimum value is 2 seconds.
$ScriptTimeout = 10;

# SECTION NMAP

# This value allows you to 'tweak' nmap's General options to fit your particular
# scanning requirements. Note, that changing these values to anything other
# than the default can result in poor results. <font color="red">You should only change
# these values if you know what you are doing!</font><hr>
# <tt>-P0</tt><blockquote>Do not try and ping hosts at all before scanning
# them. This allows the scanning of networks that don't allow ICMP echo requests (or responses)
# through their firewall. microsoft.com is an exam ple of such a network, and thus you should always
# use -P0 or -PT80 when portscanning microsoft.com.</blockquote>
# <p>
# <tt>-PT</tt><blockquote>Use TCP "ping" to determine what hosts are up.
# Instead of sending ICMP echo request packets and waiting for a response, we spew out TCP ACK packets
# throughout the target network (or to a single machine) and then wait for responses to trickle
# back. Hosts that are up should respond with a RST. This option preserves the efficiency of only scaning
# hosts that are up while still allowing you to scan networks/hosts that block ping packets. For
# non root users, we use connect(). To set the  destination port of the probe packets use -PT<port
# number>. The default port is 80, since this port is often not filtered out.</blockquote>
# <p> <tt>-PS</tt><blockquote>This option uses SYN (connection request) packets
# instead of ACK packets for root users. Hosts that are up should respond with a RST (or, rarely, a
# SYN|ACK).</blockquote>
# <p>
# <tt>-PI</tt><blockquote>This option uses a true ping (ICMP echo request)
# packet. It finds hosts that are up and also looks for subnet-directed broadcast addresses on your
# network. These are IP addresses which are externally reachable and translate to a broadcast of
# incomming IP packets to a subnet of computers. These should be eliminated if found as they allow
# for numerous denial of service attacks (Smurf is the most common).</blockquote> <p>
# <tt>-PB</tt><blockquote>This is the default ping type. It uses both the
# ACK ( -PT ) and ICMP ( -PI ) sweeps in parallel. This way you can get firewalls that filter either
# one (but not both).</blockquote>
# <p>
# <tt>-M max_sockets</tt><blockquote>Sets the maximum
# number of sockets that will be used in parallel for a TCP connect() scan (the default).
# This is useful to slow down the scan a little bit and avoid crashing remote machines.
# Another approach is to use -sS, which is generally easier for machines to handle.
$nmap_general_options = "-PB";

# Generally Nmap does a good job at adjusting for Network characteristics at runtime and scanning as
# fast as possible while minimizing that chances of hosts/ports going undetected. However, there are
# same cases where Nmap's default timing policy may not meet your objectives. The following options
# provide a fine level of control over the scan timing: <p>
# <tt>--host_timeout &lt;milliseconds&gt;</tt><blockquote>
# Specifies the amount of time Nmap is allowed to spend scanning a single host before giving up on
# that IP. The default timing mode has no host timeout.</blockquote>
# <tt>--max_rtt_timeout &lt;milliseconds&gt;</tt><blockquote>
# Specifies the maximum amount of time Nmap is allowed to wait for a probe response before
# retransmitting or timing out that particular probe. The default mode sets this to about 9000.</blockquote>
# <tt>--min_rtt_timeout &lt;milliseconds&gt;</tt><blockquote>
# When the target hosts start to establish a pattern of responding very quickly, Nmap will shrink the
# amount of time given per probe. This speeds up the scan, but can lead to missed packets when a
# response takes longer than usual. With this parameter you can guarantee that Nmap will wait at least
# the given amount of time before giving up on a probe.</blockquote>
# <tt>--initial_rtt_timeout &lt;milliseconds&gt;</tt><blockquote>
# Specifies the initial probe timeout. This is generally only useful when scanning firwalled hosts
# with -P0. Normally Nmap can obtain good RTT  estimates from the ping and the first few probes. The
# default mode uses 6000.</blockquote> <tt>--max_parallelism &lt;number&gt;</tt><blockquote>
# Specifies the maximum number of scans Nmap is allowed to perform in parallel. Setting this to
# one means Nmap will never try to scan more than 1 port at a time. It also effects other parallel
# scans such as ping sweep, RPC scan, etc.</blockquote>
# <tt>--scan_delay &lt;milliseconds&gt;</tt><blockquote>
# Specifies the minimum amount of time Nmap must wait between probes. This is mostly useful to reduce
# network load or to slow the scan way down to sneak under IDS thresholds.</blockquote>
$nmap_extra_options = "--min_rtt_timeout 200 --host_timeout 60000";

# The default scanning mode is -sT you can change that value
# here to -sS, -sF, -sX, -sN (experts only).
$NmapScan = "-sT";


# SECTION FILES

# The nPulseurl is a URL path to the npulse program. Typically the program
# is placed in your CGI directory on your web server. nPulsecmd is a full
# path specification to the nPulse program.
$nPulseurl         = $Cgiurl."/npulse.cgi";
$nPulsecmd         = $Cgidir."/npulse.cgi";

# You can customize the home page for both regular and admin users.
# Set these values to the full path name of the welcome files.
$AdminWelcome      = $Htmldir."/adminwelcome";
$UserWelcome       = $Htmldir."/userwelcome";

# These values should be changed only if you have a conflict.
$Copyrightfile      = $Htmldir."/copyright.html";
$Helpfile           = $Htmldir."/help.html";
$Eventlogfile       = $Vardir."/event.log";
$Compactdisplay_url = $nPulseurl.'?a=display&f=default_compact';
$Basicdisplay_url   = $nPulseurl.'?a=display&f=default_basic';
$Listdisplay_url    = $nPulseurl.'?a=display&f=default_list';
$Help_url           = $nPulseurl.'?a=display&s=help';
$Home_url           = $nPulseurl;
$Copyright_url      = $nPulseurl.'?a=display&s=copyright';
$Logout_url         = $Cgiurl."/session_login.cgi?logout=1";

# Typically these parameters do not need to be changed.
$Autorecheck      = $Cgidir."/autorecheck.pl";
$Preferencefile   = $Cgidir."/preferences.pl";
$Servicesfile     = $Cgidir."/services";
$Cgilib           = $Cgidir."/cgi-lib.pl";
$Currentfile      = $Basedir."/currentfile.txt";
$Infofile         = $Basedir."/infofile.txt";
$Configfile       = $Configdir."/configfile";
$Userfile         = $Configdir."/miniserv.users";
$Ucmdfile         = $Configdir."/usercmds.txt";
$Miniconfig       = $Configdir."/miniserv.conf";

# These are the DEMO files.
$TracerouteDemo   = $Htmldir."/traceroute.demo";
$FullPortDemo     = $Htmldir."/fullport.demo";
$QuickPortDemo    = $Htmldir."/quickport.demo";

# SECTION USERS
# sub UserMod

# SECTION SCRIPTS
# sub ScriptPage

# SECTION TELNET
# These paramters affect the terminal emulation characteristics
$Term_foreground = "#00ffff";
$Term_background = "#000000";
$Term_border     = "2";
$Term_scrollBar  = "West";
$Term_id         = "vt100";
$Term_buffer     = "100";
$Term_size       = "[80, 24]";
$Term_font       = "Monospaced";
$Term_fontStyle  = "plain";
$Term_fontSize   = "11";

# These parameters controll the height and width (in pixels) of the telnet window.
# The default values for an 11pt font size is (360 x 590)
$Screen_height  = 360;
$Screen_width   = 590;

# These parameters allow you to change the connection parameters
$Socket_relay     = $ENV{'SERVER_NAME'};
$Socket_relayPort = "31415";

# SECTION WEB_SERVER
# sub MiniServMod

# SECTION HIDDEN
# -- END AUTO PREFERENCES ---------------------------------------#
# -- The following must be changed manually. ------------------- #

# Stat values probably do not need to be changed.
$Stat_ok   = 1;
$Stat_warn = 2;
$Stat_fail = 3;

# I like short month names, but you can change them
@Months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);

# If you want to see Debugging info, set DEBUG to one (1). Beware, though,
# that the screens will not look right as a result. To write to a debug
# file, set ADEBUG to one (1).
$DEBUG  = 0;
$ADEBUG = 0;

# Demonstration mode flag
$DEMO   = 0;

# This is the template file for each site. Comment lines start with a #
# Template lines are of the form Name_Position => Default
$Templatetext = "ip => undef, ".
                "icon => undef, ".
                "os => undef, ".
                "CustomerID_1 => undef, ".
                "Location_2 => undef, ".
                "Host_3 => undef, ".
                "Phone_4 => undef, ".
                "Pager_5 => undef, ".
                "Email_6 => undef, ".
                "Comments_7 => undef, ".
                "Alias_8 => undef, ".
                "Icon_9 => undef, ".
                "GroupID_10 => undef, ".
                "CustomID_11 => undef, ".
                "Notify_12 => undef";

$Fxs = "font-size:".$Fontsize_xsmall .'pt';
$Fss = "font-size:".$Fontsize_small  .'pt';
$Fsn = "font-size:".$Fontsize_normal .'pt';
$Fsl = "font-size:".$Fontsize_large  .'pt';
$Fsh = "font-size:".$Fontsize_huge   .'pt';

$IsIE = $IsNS = $IsMac = 0;

# -- End Configurable items --------------------------------------------------------#
# Fix badly formed values here

$Basiccols       = 2   unless $Basiccols      > 2;
$RecheckTimeout  = 2   unless $RecheckTimeout > 2;
$Maxhistorytime  = 1   unless $Maxhistorytime > 1;
$MaxEvents       = 0   unless $MaxEvents      > 0;
$PingTimeout     = 2   unless $PingTimeout    > 2;
$ScriptTimeout   = 2   unless $ScriptTimeout  > 2;
$ListStyle       = 1   unless (($ListStyle > 0) and ($ListStyle <= 3));
$CmdTimer        = 10  unless $CmdTimer       > 10;
$CmdTimer = int($CmdTimer);
$MaxEventLogSize = $MaxEvents unless $MaxEventLogSize > $MaxEvents;

if (($Stat_ok == $Stat_warn) or ($Stat_ok == $Stat_fail) or ($Stat_warn == $Stat_fail)) {
  $Stat_ok   = 1;
  $Stat_warn = 2;
  $Stat_fail = 3;
}

$DefaultSort ||= 'ip';
$DefaultSort = 'ip' unless (($Templatetext =~ /$DefaultSort =>/) or ($DefaultSort eq 'name'));

# -- End of preferences.pl  --------------------------------------------------------#
1;
