Like I suggested above, there are two possible aproaches when you want to use Cacti for monitoring: by collecting monitoring data thru any SNMP OID (either pre-package or custom ones) or thru a script.
I've chosen the second alternative (not exactly sure why
) and I've been collecting and monitoring Yacy data from two sources: http://myserver:8090/Network.xml
Below follow some screenshots of what you get, as well as attachments for the Cacti templates and the scripts for those who want to try.
DISCLAIMER: Those two C scripts were my first C programs (I'm an old COBOL programmer
so they probably can be optimized and better stylished. Nevertheless, they're running smoothly (at least in my Ubuntu 14.04 server).
(Note: The vertical gap in the graphs is a power outage that happened yesterday)
In Cacti, you can expand any of the graphs above by clicking on them. Below, a screenshot of one of them:
Also, I had some minor issues regarding file locks, when executing the scripts, due to the way I designed the data collecting process: instead of directly reading the web xml produced by Yacy (too much for my zero knowledge in C), I chose to create two crontab entries to download the xml from Yacy to local files aimed to be the script inputs. The issue was that sometimes Cacti was executing the scripts at the exact same time as wget, so sometimes they were not producing any data. I solved this by using a temporary file and delaying the download process by some seconds. The two crontab entries are:
* * * * * sleep 30; wget -O /home/user/bin/tmp.xml http://ipaddress:8090/Network.xml
> /home/user/log/yacy_wget.log 2>&1; mv /home/user/bin/tmp.xml /home/user/bin/Network.xml
* * * * * sleep 30; curl -o /home/user/bin/tmp1.xml -u admin:password http://ipaddress:8090/PerformanceMemory_p.xml
> /home/user/log/yacy_curl.log 2>&1; mv /home/user/bin/tmp1.xml /home/user/bin/PerformanceMemory_p.xml
(you may want to customize user, ipaddress and password to your linux user, server ip and yacy admin password, respectively)
The scrips run every minute to be in sync with Cacti polling interval, which, in my case, is a 1 minute interval.