Menu

submit a value to the action type=shell-cmd

Help
Ronny H
2009-01-05
2012-12-14
  • Ronny H

    Ronny H - 2009-01-05

    Hello

    I try to send every minute the last outdoor temperature to the rrdtool command. In the documents i see that exists a "shell-cmd". How can i submit one or more values to the action command? My rule shows like that:

           <rule id="time_date">
                <condition type="timer" trigger="true">
                    <every>60</every>
                </condition>
                <actionlist>
                    <action type="shell-cmd" cmd="command.sh" />
                </actionlist>
            </rule>

     
    • jef2000

      jef2000 - 2009-01-13

      Hi,

      It's not possible to include the value of an object in shell commands.
      Something you can do is configure persistency:
      <persistence type="file" path="/var/lib/linknx/persist"/>
      and the object you want to monitor:
      <object type="9.xxx" id="outdoor_temp" init="persist">Outdoor temp</object>

      With this configuration, the value of object "outdoor_temp" will be written to file /var/lib/linknx/persist/outdoor_temp every time the value changes
      (it's a good idea to choose a persistency path located on a ramdisk to avoid unnecessary write to disk or flash)

      Then, your shell script called command.sh can execute every minute and access that file to know the actual object value.

      Regards,

      Jean-François

       
      • Ronny H

        Ronny H - 2009-01-13

        Hi,

        my actually config does it. I hope for a better solution. But ok, i can do it with persist value, thats not a problem. Your suggestion for the ramdisk is good thing for small clients! I am use my server at home, that's why i have not problems with a lot of disk write. But i test this too!

        Thanks Ronny.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.