The pfSense Store

Author Topic: Pfsense on a HP Netserver LPr  (Read 6488 times)

0 Members and 1 Guest are viewing this topic.

Offline ugob

  • Jr. Member
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: Pfsense on a HP Netserver LPr
« Reply #15 on: June 19, 2007, 01:44:09 pm »
See this post to follow-up on the monitoring... http://forum.pfsense.org/index.php/topic,5263.0.html

Offline Matts

  • Jr. Member
  • **
  • Posts: 95
  • Karma: +0/-0
    • View Profile
Re: Pfsense on a HP Netserver LPr
« Reply #16 on: June 19, 2007, 08:08:23 pm »
I have installed the AMRSTAT Port, but I can;t get it working.

FreeBSD is actually quite new for me :) If it was Linux.. it was more simple ;)

Offline ugob

  • Jr. Member
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: Pfsense on a HP Netserver LPr
« Reply #17 on: June 19, 2007, 09:49:39 pm »

Offline Matts

  • Jr. Member
  • **
  • Posts: 95
  • Karma: +0/-0
    • View Profile
Re: Pfsense on a HP Netserver LPr
« Reply #18 on: June 20, 2007, 06:26:06 am »
I found something:

Code: [Select]
# pkg_add -r http://ftp.id.freebsd.org/ports/packages/All/amrstat-20070216.tbz
# rehash
# amrstat
Logical volume 0:       degraded (16.96 GB, RAID1)
Physical drive 0:0      rebuild
Physical drive 0:1      online

Now you can use a remote server to execute amrstat remotely via ssh and grep for 'degraded'.  If grep returns 0, send an e-mail.

Ugo



Hi,

I already installed it using this:

Code: [Select]
pkg_add -r amrstat
This is what I get because I already installed the latest version I thought

Code: [Select]
# pkg_add -r http://ftp.id.freebsd.org/ports/packages/All/amrstat-20070216.tbz
Fetching http://ftp.id.freebsd.org/ports/packages/All/amrstat-20070216.tbz... Done.
pkg_add: package 'amrstat-20070216' or its older version already installed
#


And I get this now:

Code: [Select]
# amrstat
open: No such file or directory
# where amrstat
/usr/local/sbin/amrstat
# /usr/local/sbin/amrstat
open: No such file or directory
# /usr/local/sbin/amrstat --help
amrstat: illegal option -- -
usage: /usr/local/sbin/amrstat [-a num] [-b] [-c ctlr|-f dev] [-g] [-l vol]
                [-p drive|-s bus[:target]] [-t usec] [-v]

        -a num          number of retries
        -b              battery status
        -c ctrl         controller ID
        -f dev          device path
        -g              print global parameters
        -l vol          logical volume ID
        -p drive        physical drive ID
        -s bus[:target] SCSI bus (and optinal target)
        -t usec         sleep time between retries
        -v              verbose output
#


Offline ugob

  • Jr. Member
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: Pfsense on a HP Netserver LPr
« Reply #19 on: June 20, 2007, 07:29:32 am »
Maybe your RAID controller is not supported by this program.  How are labeled your disks?

Offline Matts

  • Jr. Member
  • **
  • Posts: 95
  • Karma: +0/-0
    • View Profile
Re: Pfsense on a HP Netserver LPr
« Reply #20 on: June 20, 2007, 09:34:33 am »
Maybe your RAID controller is not supported by this program. 
[/code]

I will check it, I thought it was.

[code]
How are labeled your disks?

What do you mean by this ?

Offline ugob

  • Jr. Member
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: Pfsense on a HP Netserver LPr
« Reply #21 on: June 20, 2007, 09:36:29 am »
Give me the output of 'df'

Offline Matts

  • Jr. Member
  • **
  • Posts: 95
  • Karma: +0/-0
    • View Profile
Re: Pfsense on a HP Netserver LPr
« Reply #22 on: June 20, 2007, 10:13:06 am »
Give me the output of 'df'

/dev/idad0s1a  13133670 75896 12007082     1%    /
devfs                 1     1        0   100%    /dev
/dev/md0           1710    26     1548     2%    /var/run
devfs                 1     1        0   100%    /var/dhcpd/dev


Btw, I was thinking of using smartmontools. After installing this I see that libcam* is missing.

Or we have to get a full install tree, what not should be it.

Offline ugob

  • Jr. Member
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: Pfsense on a HP Netserver LPr
« Reply #23 on: June 20, 2007, 10:17:58 am »
Give me the output of 'df'

/dev/idad0s1a  13133670 75896 12007082     1%    /
devfs                 1     1        0   100%    /dev
/dev/md0           1710    26     1548     2%    /var/run
devfs                 1     1        0   100%    /var/dhcpd/dev

Your RAID controller doesn't use the amr driver, so you can't use amrstat

Btw, I was thinking of using smartmontools. After installing this I see that libcam* is missing.

Or we have to get a full install tree, what not should be it.

If you get smartmontools, how will you get notified of a failed disk?

Offline Matts

  • Jr. Member
  • **
  • Posts: 95
  • Karma: +0/-0
    • View Profile
Re: Pfsense on a HP Netserver LPr
« Reply #24 on: June 20, 2007, 10:19:16 am »
Give me the output of 'df'

/dev/idad0s1a  13133670 75896 12007082     1%    /
devfs                 1     1        0   100%    /dev
/dev/md0           1710    26     1548     2%    /var/run
devfs                 1     1        0   100%    /var/dhcpd/dev

Your RAID controller doesn't use the amr driver, so you can't use amrstat

Btw, I was thinking of using smartmontools. After installing this I see that libcam* is missing.

Or we have to get a full install tree, what not should be it.

If you get smartmontools, how will you get notified of a failed disk?

Ow damn, just me... Brain Fart ? ;)

Offline ugob

  • Jr. Member
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: Pfsense on a HP Netserver LPr
« Reply #25 on: July 16, 2007, 12:59:28 pm »
I think I found how to do it, using an Expect script.  I haven't tried it yet 'cause I don't have the pfsense machine close, but I will as soon as I can boot it up.

Here is the script:

http://bash.cyberciti.biz/security/sshlogin.exp.php

This script is executed from a remote host, on which expect is installed.  I'm just beginning with expect, so I hard-coded all my values in the script.  I know this exposes the firewall root password in a file, but I think I can live with that until I find a better way to be alerted when a drive fails.

Code: [Select]
#! /bin/bash

RETVAL=0

/home/user/expect_amrstat > /home/user/expect_degraded

grep Degraded /home/user/expect_degraded >dev/null

RETVAL=$?
if [ "$RETVAL" = 0 ]; then
        echo "Array degraded on firewall"  |mail -s "Array Degraded" me@mydomain.com
fi

The script /home/user/expect_amrstat simply runs amrstat on the firewall and outputs the result.
« Last Edit: July 16, 2007, 02:00:36 pm by ugob »