Querying a data source that is not an IP and polling problem

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

Moderators: Developers, Moderators

Post Reply
sbotnick
Posts: 38
Joined: Tue Sep 10, 2019 12:55 am

Querying a data source that is not an IP and polling problem

Post by sbotnick »

Hello,

<edited, see 3rd message for polling issue>

I have a data source that I use a script to get a value to be graphed.
The "hostname" is the input argument for my script. From the debug, it does run once at the time the device is created, but then it does not run on subsequent polls despite all host checking being turned off.
Is there a setting I am missing that allows polling of hosts regardless if they report alive or not?

Alternatively, I could use a dummy host, such as localhost as the device hostname and use the description field for the data input method calling the script in place of <hostname> I tried using <host_description> in the input method, but that does not work. Is there a different variable name I should be using in the data input method to use the device description field as input for my script?


This is the debug output (names altered to protect the innocent):

2021/03/04 19:50:02 - SPINE: Poller[1] PID[32473] Device[232] No Device Availability Method Selected
2021/03/04 19:50:02 - SPINE: Poller[1] PID[32473] Device[232] HT[1] Device has no information for recache.
2021/03/04 19:50:02 - SPINE: Poller[1] PID[32473] Device[232] HT[1] NOTE: There are '1' Polling Items for this Device
2021/03/04 19:50:02 - SPINE: Poller[1] PID[32473] Device[232] HT[1] DS[2425] SCRIPT: /usr/bin/perl /var/lib/cacti/scripts/getValue.pl 'HostName', output: value:12.6
2021/03/04 19:50:02 - SPINE: Poller[1] PID[32473] Device[232] HT[1] Total Time: 0.29 Seconds
2021/03/04 19:55:01 - SPINE: Poller[1] PID[937] Device[232] No Device Availability Method Selected
2021/03/04 19:55:01 - SPINE: Poller[1] PID[937] Device[232] HT[1] Device has no information for recache.
2021/03/04 19:55:01 - SPINE: Poller[1] PID[937] Device[232] HT[1] Total Time: 0.0025 Seconds
2021/03/04 20:00:02 - SPINE: Poller[1] PID[1641] Device[232] No Device Availability Method Selected
2021/03/04 20:00:02 - SPINE: Poller[1] PID[1641] Device[232] HT[1] Device has no information for recache.
2021/03/04 20:00:02 - SPINE: Poller[1] PID[1641] Device[232] HT[1] Total Time: 0.0036 Seconds

Cacti v1.2.11

TIA for any help.
Last edited by sbotnick on Fri Mar 05, 2021 9:04 pm, edited 2 times in total.
sbotnick
Posts: 38
Joined: Tue Sep 10, 2019 12:55 am

Re: Querying a data source that is not an IP

Post by sbotnick »

I came up with a solution, I used the alternate plan of setting up a living dummy host to ping so the device is "alive" and figured out that using the <external_id> works.

Still curious about whether a check should be occurring when the host checks are turned off.
sbotnick
Posts: 38
Joined: Tue Sep 10, 2019 12:55 am

Re: Querying a data source that is not an IP

Post by sbotnick »

Using the external_id field as input into the script and using a live dummy hostname solved only part of the problem.

I am running my system with a 5 minute cron and 5 minute and 30 minute pollers. The 30 minute poller works correctly with SNMP devices, but my script-sourced 30 minute devices are only getting polled once at the time of creation. If I create the devices using the 5 minute poller, all is good, so I believe my config is good. I discovered that when I re-enable the problem data sources, they will run once at the next 5 minute poller interval (regardless if it has been 30 minutes since the last time it was polled or not) and never again, unless I re-enable them again. Note that the devices are not showing as disabled, I am just re-enabling them. The 30 minute devices are being checked for life every 5 minutes, so the poller does see them, it's just not getting any polling items as shown below.

Here are anonymized logs of what is happening with a device that is set up with 30 minute poller and I re-enabled the data source between 00:25 and 00:30.

2021/03/06 00:20:33 - SPINE: Poller[3] PID[31251] Device[229] IPv4 address 127.0.0.1 (127.0.0.1)
2021/03/06 00:20:34 - SPINE: Poller[3] PID[31251] Device[229] PING: Result ICMP: Device is Alive
2021/03/06 00:20:34 - SPINE: Poller[3] PID[31251] Device[229] HT[1] Device has no information for recache.
2021/03/06 00:20:34 - SPINE: Poller[3] PID[31251] Device[229] HT[1] NOTE: There are '1' Polling Items for this Device
2021/03/06 00:20:37 - SPINE: Poller[3] PID[31251] Device[229] HT[1] DS[2422] SCRIPT: /usr/bin/perl /var/lib/cacti/scripts/getValue.pl '127.0.0.1', output: value:13.44
2021/03/06 00:20:37 - SPINE: Poller[3] PID[31251] Device[229] HT[1] Total Time: 3.8 Seconds
2021/03/06 00:25:28 - SPINE: Poller[3] PID[3591] Device[229] IPv4 address 127.0.0.1 (127.0.0.1)
2021/03/06 00:25:29 - SPINE: Poller[3] PID[3591] Device[229] PING: Result ICMP: Device is Alive
2021/03/06 00:25:29 - SPINE: Poller[3] PID[3591] Device[229] HT[1] Device has no information for recache.
2021/03/06 00:25:29 - SPINE: Poller[3] PID[3591] Device[229] HT[1] Total Time: 0.86 Seconds
2021/03/06 00:30:02 - SPINE: Poller[3] PID[8209] Device[229] IPv4 address 127.0.0.1 (127.0.0.1)
2021/03/06 00:30:03 - SPINE: Poller[3] PID[8209] Device[229] PING: Result ICMP: Device is Alive
2021/03/06 00:30:03 - SPINE: Poller[3] PID[8209] Device[229] HT[1] Device has no information for recache.
2021/03/06 00:30:03 - SPINE: Poller[3] PID[8209] Device[229] HT[1] NOTE: There are '1' Polling Items for this Device
2021/03/06 00:30:06 - SPINE: Poller[3] PID[8209] Device[229] HT[1] DS[2422] SCRIPT: /usr/bin/perl /var/lib/cacti/scripts/getValuel '127.0.0.1', output: Value:13.35
2021/03/06 00:30:06 - SPINE: Poller[3] PID[8209] Device[229] HT[1] Total Time: 4.1 Seconds

After this last poll, the device will not be polled again, unless I manually re-enable.

It looks to me like there are no polling items showing up for the device at 30 minute intervals as they should be. Not sure where to go with troubleshooting at this point.
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests