Trigger perl

From Domoticz
Jump to: navigation, search

Purpose

This script will trigger a perl script every 1 minute.

Dependencies - hardware / software / operating system

This script will work on all type of hardware / software / operating system.

It could be use to trigger any perl script such :

Domoticz Setup - switches, variables, version

  • Replace ping_by_ip.pl by the name of your perl script
  • Make sure ping_by_ip.pl is located in : /usr/bin/ping_by_ip.pl
  • Make sure ping_by_ip.pl is executable : sudo chmod +x ping_by_ip.pl

Installation instructions

Copy this script in your domoticz\scripts\lua\ folder.

Script with comments

-- Script name : script_time_ping.lua
-- This script will trigger a perl script every 1 minute
-- Replace ping_by_ip.pl by the name of your perl script
-- Make sure ping_by_ip.pl is located in : /usr/bin/ping_by_ip.pl
-- Make sure ping_by_ip.pl is executable : sudo chmod +x ping_by_ip.pl
 
commandArray = {}

ping_success=os.execute('ping_by_ip.pl')
 
if ping_success then
print("ping success")
else
print("ping fail")
end
 
return commandArray

Example of use (if relevant) i.e. output files / screen displays

N/A