Read temperature data from TXT or HTML file

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
baiIvan
Posts: 3
Joined: Tue Feb 03, 2015 4:18 pm

Read temperature data from TXT or HTML file

Post by baiIvan »

Hi all,
I'm sorry if my 1st question is noob.

I have an embedded device with OpenWRT with Dallas temperature sensor (1-wire). There's a cron script which reads the temperature every minute and dumps it into a text file or HTML. For an example I can have just "27.53" in the file.

I have a paid hosting where my cacti is installed. The question is, is it possible to read the temperature from the text file and make graphs? I tried to google it, I have doubts that it can be done.

Thank you in advance!
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Read temperature data from TXT or HTML file

Post by BSOD2600 »

Sure.

Similar idea just discussed today and has almost the steps you'd follow. http://forums.cacti.net/viewtopic.php?f=21&t=54185
baiIvan
Posts: 3
Joined: Tue Feb 03, 2015 4:18 pm

Re: Read temperature data from TXT or HTML file

Post by baiIvan »

Thanks for the fast answer!
I see that SNMP is mentioned, but I don't have SNMP at all, I guess it's not that.

When I choose "Linux - Get Memory Usage", the "Input Type" is "Script/Comand" and I see it can be Perl or PHP. I have no experience with scripting, but lets assume that I have the script. Then I have to upload it to my hosting and configure it to "Input String" "perl <path_cacti>/scripts/linux_memory.pl <grepstr>"? How the script should like? It will check the HTML and the output from it will be used from Cacti for the graphs?

Thanks!
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Read temperature data from TXT or HTML file

Post by BSOD2600 »

I was hoping you'd read the actual linked guides for how to make the script for cacti... you do NOT have to use SNMP. Nor does it have to be HTML output. Read up at http://docs.cacti.net/ ;)
baiIvan
Posts: 3
Joined: Tue Feb 03, 2015 4:18 pm

Re: Read temperature data from TXT or HTML file

Post by baiIvan »

Actually I read the two links...yes not very carefully :-)

The first one Data Input Methods is talking a about scripts. The second one starts with "For this task, let's stick to SNMP stuff." :-D

I was hoping that there's some ready solution for pooling data from text file.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Read temperature data from TXT or HTML file

Post by BSOD2600 »

This subforum has lots of existing scripts where data is read from a text file... the problem is easily finding where they area since everyone does custom scripts differently and doesnt always describe their method. Will take a bit of time on your part to research, modify, and implement.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest