Access Keys:
Skip to content (Access Key - 0)
 

Switched rack PDU

David

On Jan 19, 2012 14:07

Hi, i have a apc switched rack pdu lying around witch i am trying to control with openremote.
It has 8 switchable power outlets and has its own basic web interface to control them.
The web interface uses html post to send the commands (one page to select wich oultets and what to do with them and one to confirm)
It also had ssh acces and with console u have to go tru a sequence of menus to control the outlets (mostly while typing numbers)
I have tried both the html command option (but saw no option for post parameters) as the telnet command option (by giving the login and number sequence with enters into notepad and copy pasting it to the telenet command field) What would be the easiest way to make this work ? And if it is possible are there some examples i might follow ?

Regards

 
Labels:
Participants: Caspar Banis , Eric Bariaux , Juha Lindfors , Marcus Redeker , David
  1. Jan 23

    David says:

    It seems it is also possible to manage it thru snmp. Would it bepossbile to send...

    It seems it is also possible to manage it thru snmp. Would it bepossbile to send snmp commands with openremote ?

    1. Jan 23

      Eric Bariaux says:

      There is no SNMP module right now. This has been mentioned in the past and as th...

      There is no SNMP module right now. This has been mentioned in the past and as there are a few SNMP stacks in Java, should not be too difficult to implement.
      If somebody wants to have a go at it, we'll be glad to provide support through the forums.

      1. Feb 12

        David says:

        Hi, I just made a basic snmp module that switches my light connected to the pdu ...

        Hi, I just made a basic snmp module that switches my light connected to the pdu on.
        For now it has the ip, port, oid etc hardcoded and no security in it but i am going to try and make it way more generic.
        I based my snmp module on the telnet module and using snmp4j libraries. (distributed under apache 2.0 licence i hope that's ok ?)
        Most stuff was well explained on the Openremote Documentation pages but maybe you can add some stuff about external libraries. That's where i had some trouble with (might be because im a .net dev and have no java building experience).
        I didn't know where to put the snmp4j lib in the controller so i added it to the lib folder in the controller dir and added
        <path id = "compile.path.id">
        <fileset dir = "${lib.dir}/snmp4j"/>
        to the build.xml file. I thought building the built war file would include it somehow but that was not the case so i had to add the snmp4j jar to Runtime\apache-tomcat-6.0.18\webapps\controller\WEB-INF\lib manually.
        (Maybe my whole approach is not right and its way simpler in another way)

        1. Feb 13

          Marcus Redeker says:

          The "compile.path.id" is only for the java compiler. For the runtime the jar als...

          The "compile.path.id" is only for the java compiler.
          For the runtime the jar also needs to be copied to WEB-INF/lib as you already figured out correctly.
          This is done in the ant build.xml in the "init" target. There is a command

           <copy todir = "${build.dir}/lib" flatten = "true"> 
          which takes the needed jar's and copies them all into one folder. That is later used and packed into WEB-INF/lib. If you add your jar with an additional fileset it should end up in the war file.

        2. Feb 15

          Eric Bariaux says:

          David, Glad you did manage to have something working there. If you want to con...

          David,

          Glad you did manage to have something working there.

          If you want to contribute your code (so maybe others can also enhance it if required and I can give it a try), please take a look at http://www.openremote.org/display/project/Contributor+License+Agreement+Signup
          and here http://www.openremote.org/display/Community/New+Contributors+Getting+Started

          Thanks,
          Eric

          1. Feb 27

            David says:

            Hi, i tried adding my changes to the repository from within Eclipse by creating ...

            Hi, i tried adding my changes to the repository from within Eclipse by creating a branch and setting the branch folder to http://openremote.svn.sourceforge.net/viewvc/openremote/workspace/rde01/
            But seems i messed up and it landed in http://openremote.svn.sourceforge.net/viewvc/openremote/branches/https%3A/
            I do not seem to be able to relocate it. Is it possible for one of you admins do that? Sorry for the trouble by not following the guide to the letter.

          2. Mar 03

            David says:

            So now that i managed to get the code in the right place (http://openremote.svn....

            So now that i managed to get the code in the right place (http://openremote.svn.sourceforge.net/viewvc/openremote/workspace/rde01/)
            maybe i should explain some stuff:

            For now only snmpv1 get and set commands are possible.
            (no snmp traps but i might add that when an event receiver interface is added)

            For snmp both set and get commands your command needs a port ipAdress and oid and the commandtype.

            For snmp set commands you can specify the value it should be set to and the type of that value.
            I have only tested it with Integer32 but (BIT STRING,OCTET STRING,OBJECT IDENTIFIER,TimeTicks,Counter,Counter64,Gauge,IpAddress) should all be possible

            For snmp get commands you can specify a regex and a regex replacement value.
            You can use grouping in the regex and use | in the regexreplacement to specify a replacement for each group.
            You can specify null in the regexreplacement to get the exact string where the regex matched on

            For example:

            For getting the status of an outlet i use:

            snmp get return value > regex > regexreplacement > output

            1 > (\b1\b)|(\b2\b) > on|off > on
            2 > (\b1\b)|(\b2\b) > on|off > off

            or for getting the cpu load in % on my nas with snmp:

            0.60 > 0{1}\.([0-9]{2})(.*) > null| % > 60%

            Maybe i made it to complicated but i did not seem to find another way to make it possible to make it flexible to influence the output values.

            Anyway here is part of my controller.xml:

            <command id="20" protocol="snmp">
            <property name="port" value="161" />
            <property name="ipAddress" value="192.168.2.3" />
            <property name="oid" value="1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.3" />
            <property name="command" value="set" />
            <property name="setvalue" value="1" />
            <property name="settype" value="Integer32" />
            </command>
            <command id="21" protocol="snmp">
            <property name="port" value="161" />
            <property name="ipAddress" value="192.168.2.3" />
            <property name="oid" value="1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.3" />
            <property name="command" value="set" />
            <property name="setvalue" value="2" />
            <property name="settype" value="Integer32" />
            </command>
            <command id="24" protocol="snmp">
            <property name="port" value="161" />
            <property name="ipAddress" value="192.168.2.3" />
            <property name="oid" value="1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.3" />
            <property name="command" value="get" />
            <property name="getregex" value="(\b1\b)|(\b2\b)" />
            <property name="getregexreplacement" value="on|off" />
            </command>
            <command id="125" protocol="snmp">
            <property name="port" value="161" />
            <property name="ipAddress" value="192.168.2.3" />
            <property name="oid" value="1.3.6.1.2.1.1.1.0" />
            <property name="command" value="get" />
            <property name="getregex" value="" />
            <property name="getregexreplacement" value="" />
            </command>
            <command id="124" protocol="snmp">
            <property name="port" value="161" />
            <property name="ipAddress" value="192.168.2.3" />
            <property name="oid" value="1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1" />
            <property name="command" value="get" />
            </command>
            <command id="123" protocol="snmp">
            <property name="port" value="161" />
            <property name="ipAddress" value="192.168.2.229" />
            <property name="oid" value="1.3.6.1.4.1.2021.10.1.3.1" />
            <property name="command" value="get" />
            <property name="getregex" value="0{1}\.([0-9]{2})(.*)" />
            <property name="getregexreplacement" value="null| %" />
            </command>

            1. Mar 04

              Juha Lindfors says:

              Hello David, First, thank you for this contribution. I'll schedule your work br...

              Hello David,

              First, thank you for this contribution. I'll schedule your work branch for review and then for inclusion into the controller and designer release cycles.

              I've created a how-to page where you can collect information about your implementation, here: OpenRemote 2.0 How To - SNMP Protocol, you should have access rights to make changes there. This way the information has a more permanent home than this forum thread.

              Have a look at other how to pages for templates, you can view the wiki source to see how to use the markup.

              – Juha

  2. Apr 13

    Caspar Banis says:

    I want to use the SNMPv1 protocol to send commands to an ethernet relay. Can som...

    I want to use the SNMPv1 protocol to send commands to an ethernet relay. Can someone tell me which files I need from: http://openremote.svn.sourceforge.net/viewvc/openremote/workspace/rde01/

    Where do I need to put them to get the SNMPv1 module working in my controller? It is a bit confusing because the directories differ from my controller. It would be great if I can get similar lines like in the example controller.xml above working in my controller.

    Thanks in advance!

    Caspar

    1. Apr 18

      Marcus Redeker says:

      Which version of the controlelr are you using? In general you would only need th...

      Which version of the controlelr are you using?
      In general you would only need the files from "/src/org/openremote/controller/protocol/snmp/".
      To compile and run those you also need the snmp4j jar file: "/lib/snmp4j/snmp4j-2.0.3.jar"

      When you have those compiled put them in your controller under: controller/WEB-INF/classes/org/openremote/controller/protocol/snmp
      The snmp4j-2.0.3.jar has to go to: controller/WEB-INF/lib

      Any you need to register the new CommandBuilder in the file: controller/WEB-INF/classes/applicationContext.xml

  3. Apr 24

    Caspar Banis says:

    I think I am using the latest one 2.0? I will give it a try. Thanks for your hel...

    I think I am using the latest one 2.0? I will give it a try. Thanks for your help!

    Caspar

Adaptavist Theme Builder Powered by Atlassian Confluence
Free theme builder license