Device without Internet

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
FredZwarts
Posts: 18
Joined: Wed Feb 01, 2023 5:27 am

Device without Internet

Post by FredZwarts »

Hello,
I started using Cacti a few weeks ago, so I am rather new. I succeeded to create graphs for more or less standard devices, such as my NAS, my Router and the Linux system that hosts the Cacti server, using SNMP and local templates.
Now I want to add a new device, my Solar Panel system. I tried to create a new template for this device, but I have a few problems. Maybe I missed it in the documentation, so, I would be happy with pointers to the documentation, or with other suggestions.
The first problem is that each device seems to require a FQDN or IP address, but my device is not on the Network. It communicates with my Linux system using a serial port connection. I want to write some scripts to interface this system with Cacti. I do not think that I am the first one in such a situation. So my question is how does one configure a Cacti device for a device without IP?
The second question is a related one. I would like to use an offline detection method, because my solar panels are only online (via the serial line) during day time (and 'day time' means when there is enough light, which varies from day to day). For offline detection I see only methods that use IP (ping or SNMP). Is it possible to create my own offline detection method, using a script and how is it done?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Device without Internet

Post by TheWitness »

If you use localhost, you don't need internet, an use service check none. for data input method just use a script to gather the data. Easy peasy.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
FredZwarts
Posts: 18
Joined: Wed Feb 01, 2023 5:27 am

Re: Device without Internet

Post by FredZwarts »

TheWitness wrote: Wed Feb 01, 2023 6:35 am If you use localhost, you don't need internet, an use service check none. for data input method just use a script to gather the data. Easy peasy.
Thanks, localhost will work, but it is more a work-around than a solution.
Further, do you mean that it not possible to make my own offline detection method? That would be a pity, because I would like to provide uptime information for the device.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Device without Internet

Post by TheWitness »

That is offline, are you meaning, you would like to store the data elsewhere and siphone it into the RRDfiles as opposed to polling?
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
FredZwarts
Posts: 18
Joined: Wed Feb 01, 2023 5:27 am

Re: Device without Internet

Post by FredZwarts »

TheWitness wrote: Wed Feb 01, 2023 6:46 am That is offline, are you meaning, you would like to store the data elsewhere and siphone it into the RRDfiles as opposed to polling?
No, I mean that during the night the device is down, so it does not gather data and cannot be contacted. I can poll it normally only during day time. I thought that that is where offline detection is for. To tell cacti when it makes no sense to poll because a device is offline.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Device without Internet

Post by TheWitness »

How do you know it's up or down in the script?
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Device without Internet

Post by TheWitness »

What I would likely do for this, as a beginner is write a cron that simply writes the last good known data to a file, and cactus data input method would just read from the file every polling cycle. File is always there, so no timeouts.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Device without Internet

Post by TheWitness »

Second option is to auto-disable and enable the device through a cron script.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
FredZwarts
Posts: 18
Joined: Wed Feb 01, 2023 5:27 am

Re: Device without Internet

Post by FredZwarts »

TheWitness wrote: Wed Feb 01, 2023 6:58 am How do you know it's up or down in the script?
When the script sees a time-out when contacting the device over the serial line.
FredZwarts
Posts: 18
Joined: Wed Feb 01, 2023 5:27 am

Re: Device without Internet

Post by FredZwarts »

TheWitness wrote: Wed Feb 01, 2023 7:00 am What I would likely do for this, as a beginner is write a cron that simply writes the last good known data to a file, and cactus data input method would just read from the file every polling cycle. File is always there, so no timeouts.
Is it also possible for a script to report invalid data? E.g., what happens when a script returns null, or nan, instead of a valid number? I ask this, because the last good known data are not very useful, I would prefer to see a hole in the graph instead of values that look as if they mean something.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Device without Internet

Post by TheWitness »

If the script return 'U'. That means a bad response. We recently added a function in cacti where you can set a timeout for you PHP script like 3-4 seconds so it does not block you poller too.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Device without Internet

Post by TheWitness »

It's in lib/poller.php
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
FredZwarts
Posts: 18
Joined: Wed Feb 01, 2023 5:27 am

Re: Device without Internet

Post by FredZwarts »

TheWitness wrote: Wed Feb 01, 2023 6:25 pm If the script return 'U'. That means a bad response. We recently added a function in cacti where you can set a timeout for you PHP script like 3-4 seconds so it does not block you poller too.
That is good to hear. The problem remains that the solar panel system has many parameters and therefore it will need many scripts. Even if each of them times out in a few seconds, the added time-outs will still be significant. That is the reason why I would like to be able to add an offline detection method, so that the time-out would happen only once (because I hope that if cacti knows about the offline status, it will not poll the other parameters).
Wouldn't it be a nice feature if we could create our own offline detection methods?
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests