# -- 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";

# SECTION COMMANDS

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

# 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' and 'Compact' pages. Values are defined by the keys in
# the $Templatetext variable in the 'preferences.pl' file 
# (with 'name' as an additional value).
$DefaultSort = "ip";

# 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. AlwaysShowNums is typically
# zero (0); set it to one (1) to always display the numerical
# data associated with the history graphic. 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;
$AlwaysShowNums   = 0;
$PortHistory      = 2;

# 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 = $Stat_ok;
$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;

# Nmap adapts when hosts start to establish a quickly responding pattern.
# This speeds up the scan, but can lead to missed packets.
# With this parameter you can guarantee that Nmap will wait at least
# 'MinRttTimeout' milliseconds before giving up on a probe.
$MinRttTimeout = 200;

# By default Nmap sends both ICMP and TCP ACK requests to determine if a
# host is alive. For hosts that are down, this slows down the scan. But
# some networks/firewalls block ICMP requests. To use only ICMP pings
# set TruePing to one (1). To use ICMP and ACK, set TruePing to zero (0).
$TruePing = 1;

# Scan delay pecifies 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. The value
# is in milliseconds. (Set to zero (0) to disable any delay.)
$ScanDelay = 0;

# 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';
$Help_url           = $nPULSEurl.'?a=display&s=help';
$Home_url           = $nPULSEurl;
$Copyright_url      = $nPULSEurl.'?a=display&s=copyright';

# 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";

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

# 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";

$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;
$MinRttTimeout   = 100 unless $MinRttTimeout  > 100;
$Maxhistorytime  = 1   unless $Maxhistorytime > 1;
$ScanDelay       = 0   unless $ScanDelay      > 0;
$MaxEvents       = 0   unless $MaxEvents      > 0;
$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;
