Hi,

On Thu, Feb 14, 2008 at 10:35:29AM -0700, Damon Estep wrote:
> > > and a review of the script confirms that it has no mechanism to
> > return a
> > > hostlist when queried.
> > 
> > Right, and that's a prerequisite for all stonith plugins. They
> > must return (print) a list of nodes which they can manage.
> > I'm afraid that this stonith plugin is not good. If anybody's
> > using it, I'd really like to know how. The parameters are
> > host/community/outlet, but they should be
> > 
> > host (as in 'which node is managed here")
> > ipaddr (the ip address of the stonith device unit)
> > community
> > outlet (the outlet to which this host is connected)
> > 
> > Thanks,
> > 
> > Dejan
> > 
> > P.S. CC-ing the author, perhaps he could help...
> [Damon Estep] 
> 
> Author is aware (but like the rest of us, has limited time), tested in
> V1 2 node only, in which case it is said to work. I have been
> communicating with him on it.
> 
> I think the best solution would be to make this accept two more
> parameters and return the nodelist when queried;
> 
> 1. hostlist, so clones can be created
> 2. SNMP OID (have found that different APC modes have different OIDs)
> 
> Right now the OID is hard coded in the script but it could be easily
> moved to a parameter.

That's a good idea. But what about the various switch (integer)
values?

> Thanks for taking a look, I really appreciate it. I have been running in
> circles for 2 days on this.

Sorry for that. Can you tried the attached version?

Thanks,

Dejan

> Damon
> 
> _______________________________________________
> Linux-HA mailing list
> [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
#!/bin/sh
#
# External STONITH module for APC Switched Rack PDU (software version 3.x)
#
# Copyright (c) 2007 Sergey Maznichenko <[EMAIL PROTECTED]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it would be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like.  Any license provided herein, whether implied or
# otherwise, applies only to this software file.  Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
#

#
# I wonder if this is universal.
#

SWITCH_ON="1"
SWITCH_OFF="2"
SWITCH_RESET="3"

COMMAND="snmpset -v1 -c $community $pduip $oid$outlet i "

case $1 in
gethosts)
        echo $host
        exit 0
        ;;
on)
        $COMMAND$SWITCH_ON
        exit 0
        ;;
off)
        $COMMAND$SWITCH_OFF
        exit 0
        ;;
reset)
        $COMMAND$SWITCH_RESET
        exit 0
        ;;
status)
        if [ -z "$pduip" ]; then
                exit 1
        fi
        if ping -w1 -c1 "$pduip" 2>&1 | grep "unknown host"; then
                exit 1
        else
                exit 0
        fi
        ;;
getconfignames)
        echo "host pduip community oid outlet"
        exit 0
        ;;
getinfo-devid)
        echo "rackpdu STONITH device"
        exit 0
        ;;
getinfo-devname)
        echo "rackpdu STONITH external device"
        exit 0
        ;;
getinfo-devdescr)
        echo "APC Switched Rack PDU AP7952"
        exit 0
        ;;
getinfo-devurl)
        echo "http://www.apc.com/products/family/index.cfm?id=70";
        exit 0
        ;;
getinfo-xml)
        cat << PDUXML
<parameters>
<parameter name="host" unique="0" required="1">
<content type="string" />
<shortdesc lang="en">
Name or IP address of the node to be managed.
</shortdesc>
<longdesc lang="en">
Name or IP address of Rack PDU host.
</longdesc>
</parameter>
<parameter name="community" unique="0" required="1">
<content type="string" />
<shortdesc lang="en">
Name of write community.
</shortdesc>
<longdesc lang="en">
Name of write community.
</longdesc>
</parameter>
<parameter name="oid" unique="0" required="1">
<content type="string" />
<shortdesc lang="en">
The OID.
</shortdesc>
<longdesc lang="en">
The SNMP OID for the PDU. It is required. The original default
was ".1.3.6.1.4.1.318.1.1.4.4.2.1.3."
</longdesc>
</parameter>
<parameter name="outlet" unique="0" required="1">
<content type="string" />
<shortdesc lang="en">
Number of outlet
</shortdesc>
<longdesc lang="en">
Number of outlet.
</longdesc>
</parameter>
</parameters>
PDUXML
        exit 0
        ;;
*)
        exit 1
        ;;
esac
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to