Getting the error below when trying to run SPINE Poller script!
# /usr/local/spine/bin/spine
FATAL: Unable to read configuration file! (Spine init)
Try explicitly telling Spine where the configuration file is when running it manually:
# /usr/local/spine/bin/spine -C /usr/local/spine/etc/spine.conf
This command uses the -C
option to specify the configuration file path directly. If this works, it might indicate that Spine isn’t correctly picking up the default configuration file path in your environment.
If the above command works without the “FATAL” error, then we know Spine can read the file when explicitly told where it is. In this case, we might need to ensure that the cron job is also executing with the correct environment or that Spine, when run by cron, can find the configuration file. Since cron jobs typically run with a minimal environment, explicitly specifying the path in the cron command might be necessary.
# vi /etc/cron.d/cacti
*/5 * * * * root /usr/local/spine/bin/spine -C /usr/local/spine/etc/spine.conf
Remember to restart the cron service:
# systemctl restart crond
Monitor the Cacti log file:
# tail -f /var/log/cacti/cacti.log
Explanation:
The capital -C
option explicitly tells Spine the location of its configuration file. When run without this option, Spine relies on certain default paths or environment variables to find spine.conf
. It appears that in the environment where your cron jobs are executed, these default paths are not leading Spine to the correct location. By using -C
, we are making it unambiguous.