When I was trying to debug a custom script, I found it helpful to have the script append some information to a temp file every time it was run; that way I could make sure it was being called the way I expected. Things like the cmd line args, environment, and what value(s) it was going to return. You also might want to redirect stderr to a log file to catch error output from the script.
I see you made a Data Input Method and a Graph Template; did you also make a Data Template?
According to your logfiles, you changed the "Poller Interval" in Cacti from the default of "Every 5 Minutes" to "Every 10 Seconds".
The Cacti settings say:
Poller Interval
The polling interval in use. This setting will effect
how often rrd's are checked and updated. NOTE: If you change this
value, you must re-populate the poller cache. Failure to do so, may
result in lost data.
This won't work unless you also change it in the system's cronjob!
Also we have the cron-interval, just below of it in the settings:
Cron Interval
The cron interval in use. You need to set this setting
to the interval that your cron or scheduled task is currently running.
So, the question is: Do you really need 10-seconds sampling? REALLY? If not, revert everything to "Every 5 Minutes" and then go to "System Utilities -> Rebuild Poller Cache".
Restart cron, in case you made it not be be 5 minutes, and wait for 15 minutes. Graphs should be appearing then.
EDIT: Just saw your reply. Do not change crontab, it's ok.
Go to: "Settings -> Poller":
Set: Poller Interval = Every 5 Minutes
Set: Cron Interval = Every 5 Minutes
Save
Go to: "System Utilities":
Run "Rebuild Poller Cache"
Do not fiddle around with intervals if you don't need to.
Best Answer
With
Cacti
you are not limited only to SNMP queries.You can choose to run any script of your own as a Data Input Method. It could be
Perl
,PHP
,Python
,Bash
or whatever. Just choose the Script/Command input type :Your script has to output at least one value. This value will be attached to an output field within
Cacti
and used later to create the final graph.If you only need one output field, just print the value as it is (eg
12
) without anything else (egms
,%
) :In case you have to retrieve multiple values, the output format has to be :
Then each field will be attached to an ouput field.
You can find further explanation and examples here :