Hi all!
I face a problem, maybe with some kind of limitation in "Data Source Items".
1)
I have made a Server Script in php. It gathers an SNMP STRING of 64 bits, where each bit represent some kind of boolean status.
The script returns the processed string.
As example, the script:
fetches: 000110 (...)
returns: fan1_fail:0 fan2_fail:0 fan3_fail:0 online:1 communications_ok:1 blablabla:0 (...)
So in this example i wrote 6, but i have 64 different data items.
As far as i can see, the script works ok.
2)
I have made a Data Source Template that gets all that 64 "Data source items".
I have mapped the variables there.
3)
i have made a Graph Template (just for tests) (incomplete, only 15-16 data items).
4)
i have made the graph for a device
5)
i found a problem using spine (default result limit is 1024 characters, i compiled it again with 2048 to support all those items).
-----
All looks OK, but when i have review the "Data Source" for this device, i have found that "Data items after #22 are not getting populated".
I dont see any problem in cLog
Is there some kind of restriction in the amount of Data Items that a Data Source can handle?
Can someone point me to some log/checks?
Thanks in advance!
Regards, Daniel
(SOLVED)Custom "SS + Data Source", data breaks after X items
Moderators: Developers, Moderators
(SOLVED)Custom "SS + Data Source", data breaks after X items
Last edited by tarre on Tue Jun 05, 2018 6:59 am, edited 2 times in total.
Re: Custom "SS + Data Source", data break after 22 items pro
Ok, it has something to do with stuff outside Cacti.
As i read in this forum, maybe there are also "Operative System" argument limit.
i have modified the script output to something more simple, as for example:
where it return "some_fancy_variable_name:1", now it return "data_1:1".
With just this change, Cacti now stores properly 51 Data Sources versus the 15-16 previous.
Great! =)
I'm going to try "shortning" the output even more, and i will post results here.
As i read in this forum, maybe there are also "Operative System" argument limit.
i have modified the script output to something more simple, as for example:
where it return "some_fancy_variable_name:1", now it return "data_1:1".
With just this change, Cacti now stores properly 51 Data Sources versus the 15-16 previous.
Great! =)
I'm going to try "shortning" the output even more, and i will post results here.
Re: Custom "SS + Data Source", data break after 22 items pro
Now that i have reduced the script output even more, Cacti is properly getting all the data and storing it properly.
Time to display all data sources in graph, tidy all stuff, and i will post the template.
Regards!
Time to display all data sources in graph, tidy all stuff, and i will post the template.
Regards!
Re: (SOLVED)Custom "SS + Data Source", data breaks after X i
I have a position on this that you may or may not agree with. I would break this into a simple script that does the following:
1) One data source per RRD
2) Script that takes the data source name as in input variable and echos one response
3) In that script, you first check for the timestamp in /tmp/cacti/$monitoredhost/apcstat.out and if it's older than X minute where X is the sampling rate run the entire script, and output to that file as new
4) Grep out and echo the value afterwards.
This way, the data is returned only once and all subsequent calls during the same sampling time will simply grep out the result. You could also do this with a MySQL table too. I would label the table something like apc_stats with the following columns host_id, name, value, update_time. Then instead of using the temporary file, you would simply look at the timestamp in update_time, and if the time was old, then update the values.
By using this approach, you do not need a real wide column in the poller_output and poller_output_boost tables, you won't have to deal with an ugly RRDfile and you will maintain real good performance.
1) One data source per RRD
2) Script that takes the data source name as in input variable and echos one response
3) In that script, you first check for the timestamp in /tmp/cacti/$monitoredhost/apcstat.out and if it's older than X minute where X is the sampling rate run the entire script, and output to that file as new
4) Grep out and echo the value afterwards.
This way, the data is returned only once and all subsequent calls during the same sampling time will simply grep out the result. You could also do this with a MySQL table too. I would label the table something like apc_stats with the following columns host_id, name, value, update_time. Then instead of using the temporary file, you would simply look at the timestamp in update_time, and if the time was old, then update the values.
By using this approach, you do not need a real wide column in the poller_output and poller_output_boost tables, you won't have to deal with an ugly RRDfile and you will maintain real good performance.
Before history, there was a paradise, now dust.
Re: (SOLVED)Custom "SS + Data Source", data breaks after X i
Oh thanks, that looks to me a smarter approach It's my very first attempt to make a Cacti TemplateOsiris wrote:I have a position on this that you may or may not agree with. I would break this into a simple script that does the following:
1) One data source per RRD
2) Script that takes the data source name as in input variable and echos one response
3) In that script, you first check for the timestamp in /tmp/cacti/$monitoredhost/apcstat.out and if it's older than X minute where X is the sampling rate run the entire script, and output to that file as new
4) Grep out and echo the value afterwards.
This way, the data is returned only once and all subsequent calls during the same sampling time will simply grep out the result. You could also do this with a MySQL table too. I would label the table something like apc_stats with the following columns host_id, name, value, update_time. Then instead of using the temporary file, you would simply look at the timestamp in update_time, and if the time was old, then update the values.
By using this approach, you do not need a real wide column in the poller_output and poller_output_boost tables, you won't have to deal with an ugly RRDfile and you will maintain real good performance.
I already faced the problem with ugly RRD Data, and the output nightmare, and it look like i was making a base mistake.
The cache for the script will solve the problem with "multiple subsecuent calls", so then allow us to simplify the "Data Input" / "Data Source" / Variables mapping a lot.
I will post the work done now as it works, but as soon as i can i will try to improve this template that way.
Tnx Osiris, regards, t
Re: (SOLVED)Custom "SS + Data Source", data breaks after X i
Here comes the template. I'm learning, i'm noob, don't expect this to work.
Any feedback will be appreciated.
It's on the roadmap to apply the previous post idea from Osiris.
APC Smart UPS - Basic Status - Template
Any feedback will be appreciated.
It's on the roadmap to apply the previous post idea from Osiris.
APC Smart UPS - Basic Status - Template
Re: (SOLVED)Custom "SS + Data Source", data breaks after X i
Here i have post this "beta" template, and all others i made around APC Smart UPS device.
Hope that help others.
viewtopic.php?f=12&t=58848
Hope that help others.
viewtopic.php?f=12&t=58848
Re: (SOLVED)Custom "SS + Data Source", data breaks after X i
And here is the script, beta version, working:
Who is online
Users browsing this forum: No registered users and 2 guests