From 07cf2c4b20230ddedee1bf9dddc1e7cd407385f5 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 5 Feb 2015 10:02:24 -0200 Subject: Packages repo cleanup: - Drop support for pfSense < 2 - Remove archive/, old files can be reached using git - Remove old and unused packages - Move stale files from config subdir to a package subdir --- config/arpwatch/arpwatch.xml | 144 +++++++++++++++++++++++++++++++++++ config/arpwatch/arpwatch_reports.php | 127 ++++++++++++++++++++++++++++++ config/arpwatch/sm.php | 42 ++++++++++ 3 files changed, 313 insertions(+) create mode 100644 config/arpwatch/arpwatch.xml create mode 100755 config/arpwatch/arpwatch_reports.php create mode 100644 config/arpwatch/sm.php (limited to 'config/arpwatch') diff --git a/config/arpwatch/arpwatch.xml b/config/arpwatch/arpwatch.xml new file mode 100644 index 00000000..a40422d4 --- /dev/null +++ b/config/arpwatch/arpwatch.xml @@ -0,0 +1,144 @@ + + + + + + + + ARP Monitoring Daemon + None + Currently there are no FAQ items provided. + arpwatch + 2.1.a14 pkg v1.1.1 + arpwatch: Settings + pkg_edit.php?xml=arpwatch.xml&id=0 + + arpwatch + Modify arpwatch settings. +
Services
+ arpwatch.xml + /pkg_edit.php?xml=arpwatch.xml&id=0 +
+ + arpwatch + arpwatch.sh + arpwatch + + + + Settings + /pkg_edit.php?xml=arpwatch.xml&id=0 + + + + Reports + /arpwatch_reports.php + + + installedpackages->package->$packagename->configuration->settings + + /usr/local/www/ + a+rx + https://packages.pfsense.org/packages/config/arpwatch/arpwatch_reports.php + + + /usr/sbin/ + a+rx + https://packages.pfsense.org/packages/config/arpwatch/sm.php + + + + Listening Interface + interface + Choose the desired listening interface here. + interfaces_selection + + + Enable E-mail Notifications + enable_email + checkbox + Sends an E-mail notification for each new station and ARP change as they are seen <strong>instead of</strong> local reports.<br/>NOTE: Only works on pfSense 2.1 or later. <br/>NOTE 2: Disables local reports which rely on arpwatch debug mode, which does not work with e-mail notifications.<br/>Configure SMTP and address settings in System > Advanced on the Notifications tab + + + + 2.0) && (isset($_POST['enable_email']) || ($config['installedpackages']['arpwatch']['config'][0]['enable_email'] == "on"))) { + if (!empty($config['notifications']['smtp']['notifyemailaddress'])) + $mail = " -m \"{$config['notifications']['smtp']['notifyemailaddress']}\""; + } else { + $debug = "-d"; + } + $int = convert_friendly_interface_to_real_interface_name($int); + $start = "touch {$log_file}\n"; + $start .= "/usr/local/sbin/arpwatch {$debug} -f {$log_file} {$mail} -i {$int} > /var/log/arpwatch.reports 2>&1 &"; + $stop = "/usr/bin/killall arpwatch"; + write_rcfile(array( + "file" => "arpwatch.sh", + "start" => $start, + "stop" => $stop + ) + ); + restart_service("arpwatch"); + conf_mount_ro(); + config_unlock(); + } + ]]> + + + + + + + +
diff --git a/config/arpwatch/arpwatch_reports.php b/config/arpwatch/arpwatch_reports.php new file mode 100755 index 00000000..9b3b1c6c --- /dev/null +++ b/config/arpwatch/arpwatch_reports.php @@ -0,0 +1,127 @@ +#!/usr/local/bin/php + $newmac, + "timestamp" => trim($todo[2]), + "hostname" => trim($todo[3]) ? trim($todo[3]) : "Unknown" + ); + unset($mac); + } +} +$pgtitle = "arpwatch: Reports"; +include("head.inc"); + +?> + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + $rawentries) { + $printip = true; + $entries = $rawentries; + sort($entries); + foreach($entries as $entry) { + echo ''; + if($printip) { + echo ''; + $stampclass = "listr"; + $printip = false; + } else { + $stampclass = "listlr"; + echo ''; + } + echo ''; + echo ''; + echo ''; + echo ''; + } + } + ?> + + + +
arp.dat entries
IPTimestampMACHostname
' . $ip . '' . + date("D M j G:i:s", $entry['timestamp']) . + '' . $entry['mac'] . '' . $entry['hostname'] . '
+
+
+ +
+
+
+
diff --git a/config/arpwatch/sm.php b/config/arpwatch/sm.php new file mode 100644 index 00000000..2e1cc4a0 --- /dev/null +++ b/config/arpwatch/sm.php @@ -0,0 +1,42 @@ +#!/usr/local/bin/php -q + "") { + $subject = $options['s']; +} + + +$in = file("php://stdin"); +foreach($in as $line){ + $line = trim($line); + if ( (substr($line, 0, 6) == "From: ") + || (substr($line, 0, 6) == "Date: ") + || (substr($line, 0, 4) == "To: ")) + continue; + if (empty($subject) && (substr($line, 0, 9) == "Subject: ")) { + $subject = substr($line, 9); + continue; + } + $message .= "$line\n"; +} + +if (!empty($subject)) + send_smtp_message($message, $subject); +else + send_smtp_message($message); +?> \ No newline at end of file -- cgit v1.2.3