From 70c784c5a93cfb9f224fcd7889fcd074ad66fc6d Mon Sep 17 00:00:00 2001
From: jsatoh <junichi@rworks.jp>
Date: Sat, 10 May 2014 02:09:44 +0000
Subject: [PATCH] 2014-05-10  Junichi Satoh <junichi@rworks.jp>

	* util/recon_script/ipmi-recon.pl, util/recon_script/snmpdevices.pl,
	util/recon_script/wmi-recon.pl: Added support for FreeBSD.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9907 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
---
 pandora_server/ChangeLog                         |  5 +++++
 pandora_server/util/recon_scripts/ipmi-recon.pl  | 10 +++++++++-
 pandora_server/util/recon_scripts/snmpdevices.pl | 10 +++++++++-
 pandora_server/util/recon_scripts/wmi-recon.pl   | 16 +++++++++++++++-
 4 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog
index cea4e9d582..d2f90cb64c 100644
--- a/pandora_server/ChangeLog
+++ b/pandora_server/ChangeLog
@@ -1,3 +1,8 @@
+2014-05-10  Junichi Satoh <junichi@rworks.jp>
+
+	* util/recon_script/ipmi-recon.pl, util/recon_script/snmpdevices.pl,
+	util/recon_script/wmi-recon.pl: Added support for FreeBSD.
+
 2014-05-09  Ramon Novoa  <rnovoa@artica.es>
 
 	* bin/tentacle_server.exe: Added to repository. Tentacle server win32
diff --git a/pandora_server/util/recon_scripts/ipmi-recon.pl b/pandora_server/util/recon_scripts/ipmi-recon.pl
index e567c86c19..7cfea2d0c4 100644
--- a/pandora_server/util/recon_scripts/ipmi-recon.pl
+++ b/pandora_server/util/recon_scripts/ipmi-recon.pl
@@ -27,7 +27,15 @@ my $pkg_timeout = 3; #Pkg ping timeout wait
 ##########################################################################
 # Code begins here, do not touch
 ##########################################################################
-my $pandora_conf = "/etc/pandora/pandora_server.conf";
+my $OSNAME = $^O;
+my $pandora_conf;
+
+if ($OSNAME eq "freebsd") {
+	$pandora_conf = "/usr/local/etc/pandora/pandora_server.conf";
+} else {
+	$pandora_conf = "/etc/pandora/pandora_server.conf";
+}
+
 my $task_id = $ARGV[0]; # Passed automatically by the server
 my $target_group = $ARGV[1]; # Defined by user
 my $create_incident = $ARGV[2]; # Defined by user
diff --git a/pandora_server/util/recon_scripts/snmpdevices.pl b/pandora_server/util/recon_scripts/snmpdevices.pl
index a15fd7d496..914ad205ab 100755
--- a/pandora_server/util/recon_scripts/snmpdevices.pl
+++ b/pandora_server/util/recon_scripts/snmpdevices.pl
@@ -27,7 +27,15 @@ my $target_interval = 600;
 ##########################################################################
 # Code begins here, do not touch
 ##########################################################################
-my $pandora_conf = "/etc/pandora/pandora_server.conf";
+my $OSNAME = $^O;
+my $pandora_conf;
+
+if ($OSNAME eq "freebsd") {
+	$pandora_conf = "/usr/local/etc/pandora/pandora_server.conf";
+} else {
+	$pandora_conf = "/etc/pandora/pandora_server.conf";
+}
+
 my $task_id = $ARGV[0]; # Passed automatically by the server
 my $target_group = $ARGV[1]; # Defined by user
 my $create_incident = $ARGV[2]; # Defined by user
diff --git a/pandora_server/util/recon_scripts/wmi-recon.pl b/pandora_server/util/recon_scripts/wmi-recon.pl
index 9d59cff938..dc0f5c801a 100755
--- a/pandora_server/util/recon_scripts/wmi-recon.pl
+++ b/pandora_server/util/recon_scripts/wmi-recon.pl
@@ -18,7 +18,20 @@ use PandoraFMS::Config;
 use PandoraFMS::NmapParser;
 
 # Pandora FMS configuration hash.
-my %CONF = ('quiet' => 0,
+my $OSNAME = $^O;
+my %CONF;
+
+if ($OSNAME eq "freebsd") {
+	%CONF = ('quiet' => 0,
+			'verbosity' => 1,
+			'daemon' => 0,
+			'PID' => '',
+			'pandora_path' => '/usr/local/etc/pandora/pandora_server.conf',
+			'ping_timeout' => 2,
+			'ping_retries' => 1,
+			'wmi_client' => '/usr/local/bin/wmic');
+} else {
+	%CONF = ('quiet' => 0,
 			'verbosity' => 1,
 			'daemon' => 0,
 			'PID' => '',
@@ -26,6 +39,7 @@ my %CONF = ('quiet' => 0,
 			'ping_timeout' => 2,
 			'ping_retries' => 1,
 			'wmi_client' => '/usr/bin/wmic');
+}
 
 # If set to 1 incidents will be created in the Pandora FMS Console.
 my $CREATE_INCIDENT;