Partial output U
Moderators: Developers, Moderators
Partial output U
I need to collect temperature data from python script using cacti 0.8.8a i got the following error pls help
- Attachments
-
- untitled.JPG (153.65 KiB) Viewed 657 times
-
- Posts: 2
- Joined: Thu Jun 25, 2015 11:03 am
Re: Partial output U
I just solved a problem like this for a postfix mailqueue monitoring script. The issue for me was a bit of confusion with the user running the poller.php cron job and that user's access to the SNMPv3 credentials, as well as execute permission to the script itself in /usr/share/cacti/site/scripts .
More detail: The setup docs said to add a cron job running poller.php to /etc/crontab using a new user with id cactiuser, so I did this. The new cactiuser user had a home directory, in which I put a .snmp/snmp.conf file that had the SNMPv3 credentials. When I ran the cron job listed in /etc/crontab it worked fine, so I couldn't figure out what was going wrong.
What I didn't realize was that the cacti installer ALSO put a separate poller.php cron job in the system via the cron.d directory - /etc/cron.d/cacti . This cron job was using the www-data user for some reason, a user which had no access to the SNMPv3 credentials. Also, for some reason this is the only cron job that cacti seemed to really care about.
When I removed the cron job I manually added to /etc/crontab and changed the user running the job in /etc/cron.d/cacti to cactiuser it almost started working. The last thing I had to do is add the cactiuser user to the www-data group and change the permissions on the log dir and the files in /var/log/cacti so that the www-data group had write access there (wanted to ensure www-data still had write in case it used it for showing logs in the web GUI).
You'll also want to double check permissions in /var/lib/cacti/rra to make sure cactiuser can write there I think, and the script itself in /usr/share/cacti/site/scripts .
I'm brand new to setting up cacti so I kind of stumbled around a lot. Things that helped me solve this: Setting cacti log output to debug in the cacti GUI under Settings -> general -> Poller specific logging, checking /var/log/syslog to see what cron jobs were running (that's how I found the one in cron.d), and looking carefully at what users were running what and what permissions they all have.
One thing I would really like to know is what the variable names are for SNMPv3 authentication items, so that I can update my poller scripts to use per-host passwords instead of having to set all the passwords the same and either set up the /home/cactiuser/.snmp/snmp.conf or hard code the credentials into the poller scripts themselves.
Note: All of this is on the monitoring host, not the mail host I was collecting data from. I made sure that the mail host was setup properly by running snmp data gathering commands from the monitoring host manually.
More detail: The setup docs said to add a cron job running poller.php to /etc/crontab using a new user with id cactiuser, so I did this. The new cactiuser user had a home directory, in which I put a .snmp/snmp.conf file that had the SNMPv3 credentials. When I ran the cron job listed in /etc/crontab it worked fine, so I couldn't figure out what was going wrong.
What I didn't realize was that the cacti installer ALSO put a separate poller.php cron job in the system via the cron.d directory - /etc/cron.d/cacti . This cron job was using the www-data user for some reason, a user which had no access to the SNMPv3 credentials. Also, for some reason this is the only cron job that cacti seemed to really care about.
When I removed the cron job I manually added to /etc/crontab and changed the user running the job in /etc/cron.d/cacti to cactiuser it almost started working. The last thing I had to do is add the cactiuser user to the www-data group and change the permissions on the log dir and the files in /var/log/cacti so that the www-data group had write access there (wanted to ensure www-data still had write in case it used it for showing logs in the web GUI).
You'll also want to double check permissions in /var/lib/cacti/rra to make sure cactiuser can write there I think, and the script itself in /usr/share/cacti/site/scripts .
I'm brand new to setting up cacti so I kind of stumbled around a lot. Things that helped me solve this: Setting cacti log output to debug in the cacti GUI under Settings -> general -> Poller specific logging, checking /var/log/syslog to see what cron jobs were running (that's how I found the one in cron.d), and looking carefully at what users were running what and what permissions they all have.
One thing I would really like to know is what the variable names are for SNMPv3 authentication items, so that I can update my poller scripts to use per-host passwords instead of having to set all the passwords the same and either set up the /home/cactiuser/.snmp/snmp.conf or hard code the credentials into the poller scripts themselves.
Note: All of this is on the monitoring host, not the mail host I was collecting data from. I made sure that the mail host was setup properly by running snmp data gathering commands from the monitoring host manually.
Who is online
Users browsing this forum: No registered users and 2 guests