{"_id":"57fcc4870312b20e00ac64fa","__v":1,"parentDoc":null,"project":"5435687035740020002a1c04","version":{"_id":"57fcc4860312b20e00ac64c0","project":"5435687035740020002a1c04","__v":1,"createdAt":"2016-10-11T10:52:54.637Z","releaseDate":"2016-10-11T10:52:54.637Z","categories":["57fcc4860312b20e00ac64c1","57fcc4860312b20e00ac64c2","57fcc4860312b20e00ac64c3","57fcc4860312b20e00ac64c4","57fcc4860312b20e00ac64c5","57fcc4860312b20e00ac64c6","57fcc4860312b20e00ac64c7","57fcc4860312b20e00ac64c8","57fcc4860312b20e00ac64c9","57fcc4860312b20e00ac64ca","57fcc4860312b20e00ac64cb"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"[APP-1265], [APP-1035]","version_clean":"5.2.0","version":"5.2"},"user":"5435682035740020002a1c01","category":{"_id":"57fcc4860312b20e00ac64c9","__v":0,"version":"57fcc4860312b20e00ac64c0","project":"5435687035740020002a1c04","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-01T21:33:28.863Z","from_sync":false,"order":8,"slug":"integration-examples","title":"Integration Examples"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-08T16:07:59.384Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Source Code Available\",\n  \"body\": \"The source code for this example is available on the [Telemetry Agents Examples ](https://github.com/telemetryapp/agent_examples/tree/master/excel) Github repository.\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/agjwYBetRYi2wqnrl0Gt_methods.png\",\n        \"methods.png\",\n        \"1427\",\n        \"280\",\n        \"#2aa0f8\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n# Requirements\n\nYou'll need an OSX or Linux computer system to run through this guide. Windows is supported with Telemetry but some of the details here would be slightly different and thus it's out of scope.  You'll also of course, need an Excel document.\n\n# Installation\n\nGet the most recent agent from the [Telemetry Agent](https://github.com/telemetryapp/gotelemetry_agent/releases) Github repository.\n\n# Configure Board\n\nVisit the [Telemetry Manager](https://manager.telemetryapp.com) application, login and either create a new board or use an existing one. Add a value widget to the board and take note of the *flow_tag*. You'll use this tag to send data to.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/7ad5b5d-Screen_Shot_2017-07-26_at_10.42.52_AM.png\",\n        \"Screen Shot 2017-07-26 at 10.42.52 AM.png\",\n        263,\n        170,\n        \"#232a34\"\n      ]\n    }\n  ]\n}\n[/block]\n# Configure Agent\n\nNext, we'll need to configure the agent to run the node script and send it to Telemetry.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"#\\n# Server Configuration Parameters\\n#\\n\\n[server]\\n# API token found in the Agents tab in manager.telemetryapp.com\\napi_token = \\\"abc123abc123abc123abc123abc123abc123\\\"\\n# Submit new metrics in a batch at most every 1 second\\nsubmission_interval = \\\"1s\\\"\\n\\n[data]\\n# path = \\\"c:\\\\\\\\telemetry_agent.db\\\"\\n# WINDOWS USERS - Uncomment the line above and comment or remove the line below\\npath = \\\"/tmp/telemetry_agent.db\\\"\\n\\n#\\n# Flow Configurations \\n#\\n\\n#\\n# A specific flow\\n#\\n[[flow]]\\n# The flow tag\\ntag = \\\"excel_value_1\\\"\\n# run the script every 10 seconds\\ninterval = \\\"10s\\\"\\n# The Lua script to run\\nscript = \\\"excel.lua\\\"\\n\",\n      \"language\": \"toml\"\n    }\n  ]\n}\n[/block]\n#  Write the Lua Script\n\nWrite a Lua script that looks like the following\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"local excel = require(\\\"telemetry/excel\\\")\\n\\nlocal spreadsheet = excel.import(\\\"test.xlsx\\\")\\n\\n-- Output the value of cell B10 within sheet 1 \\noutput.number = {value = tonumber(spreadsheet[1][10][2])}\\n\",\n      \"language\": \"lua\"\n    }\n  ]\n}\n[/block]\n# Run the Agent\n\nWith the agent binary and the config file in the same directory start the agent by typing in your console:\n\n    gotelemetry_agent run -c config.toml\n\n\n# Viewing your Board and Notifications\n\nGo to [https://viewer.telemetryapp.com](https://viewer.telemetryapp.com) to create a new viewer and input its pairing code in the manager at [https://manager.telemetryapp.com/viewers](https://manager.telemetryapp.com/viewers)","excerpt":"","slug":"excel-document","type":"basic","title":"Excel Document"}
[block:callout] { "type": "info", "title": "Source Code Available", "body": "The source code for this example is available on the [Telemetry Agents Examples ](https://github.com/telemetryapp/agent_examples/tree/master/excel) Github repository." } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/agjwYBetRYi2wqnrl0Gt_methods.png", "methods.png", "1427", "280", "#2aa0f8", "" ] } ] } [/block] # Requirements You'll need an OSX or Linux computer system to run through this guide. Windows is supported with Telemetry but some of the details here would be slightly different and thus it's out of scope. You'll also of course, need an Excel document. # Installation Get the most recent agent from the [Telemetry Agent](https://github.com/telemetryapp/gotelemetry_agent/releases) Github repository. # Configure Board Visit the [Telemetry Manager](https://manager.telemetryapp.com) application, login and either create a new board or use an existing one. Add a value widget to the board and take note of the *flow_tag*. You'll use this tag to send data to. [block:image] { "images": [ { "image": [ "https://files.readme.io/7ad5b5d-Screen_Shot_2017-07-26_at_10.42.52_AM.png", "Screen Shot 2017-07-26 at 10.42.52 AM.png", 263, 170, "#232a34" ] } ] } [/block] # Configure Agent Next, we'll need to configure the agent to run the node script and send it to Telemetry. [block:code] { "codes": [ { "code": "#\n# Server Configuration Parameters\n#\n\n[server]\n# API token found in the Agents tab in manager.telemetryapp.com\napi_token = \"abc123abc123abc123abc123abc123abc123\"\n# Submit new metrics in a batch at most every 1 second\nsubmission_interval = \"1s\"\n\n[data]\n# path = \"c:\\\\telemetry_agent.db\"\n# WINDOWS USERS - Uncomment the line above and comment or remove the line below\npath = \"/tmp/telemetry_agent.db\"\n\n#\n# Flow Configurations \n#\n\n#\n# A specific flow\n#\n[[flow]]\n# The flow tag\ntag = \"excel_value_1\"\n# run the script every 10 seconds\ninterval = \"10s\"\n# The Lua script to run\nscript = \"excel.lua\"\n", "language": "toml" } ] } [/block] # Write the Lua Script Write a Lua script that looks like the following [block:code] { "codes": [ { "code": "local excel = require(\"telemetry/excel\")\n\nlocal spreadsheet = excel.import(\"test.xlsx\")\n\n-- Output the value of cell B10 within sheet 1 \noutput.number = {value = tonumber(spreadsheet[1][10][2])}\n", "language": "lua" } ] } [/block] # Run the Agent With the agent binary and the config file in the same directory start the agent by typing in your console: gotelemetry_agent run -c config.toml # Viewing your Board and Notifications Go to [https://viewer.telemetryapp.com](https://viewer.telemetryapp.com) to create a new viewer and input its pairing code in the manager at [https://manager.telemetryapp.com/viewers](https://manager.telemetryapp.com/viewers)