Starting to use Memcached and found some of the current Memcached bits in Observium not working optimally. I wrote a new unix-agent script using python rather than PHP. The previous script relied on PECL memcached but didn't do anything for installations using PECL memcache. After a bunch of trial and error I determined that it was easiest to write the script in Python which requires the python-memcached library and is readily available on different OS types and versions.
I also modified the applications/memcached.inc.php and polling/unix-agent.inc.php to accommodate the new script. They will also accurately separate different instances of memcached running on the same server as reported by the script.
I'm still trying to work out a couple things. The main thing is when you enable Memcached as an application for a device Observium automatically creates an entry in the database but the instance is NULL. When the unix-agent reports on the Memcached instance(s) running on the server new entries get created in the database for each instance and the app with the NULL app_instance never gets used. I've been manually removing it from the database. If possible I would like to work it out so that it doesn't get created automatically. If that's not possible I was going to look into updating that entry with the first real instance reported by the agent.
Also wanting to get the Apps tab for the Device to better identify each instance and maybe work on some additional metrics reporting for Memcached specific stats.
Patch attached, let me know if it is acceptable or not...
Britt Treece
On 1/06/2013 0:19, Britt Treece wrote:
I'm still trying to work out a couple things. The main thing is when you enable Memcached as an application for a device Observium automatically creates an entry in the database but the instance is NULL. When the unix-agent reports on the Memcached instance(s) running on the server new entries get created in the database for each instance and the app with the NULL app_instance never gets used. I've been manually removing it from the database. If possible I would like to work it out so that it doesn't get created automatically. If that's not possible I was going to look into updating that entry with the first real instance reported by the agent.
You can't "enable" unix-agent applications; they get autodetected when the unix agent is polled.
This is not clear from the interface, nor the documentation, but you should simply not tick the box. Problem solved. :)
Tom
Looks fine. The old one wasn't working properly anyways.
Committed in 4091.
adam.
On 2013-05-31 23:19, Britt Treece wrote:
Starting to use Memcached and found some of the current Memcached bits in Observium not working optimally. I wrote a new unix-agent script using python rather than PHP. The previous script relied on PECL memcached but didn't do anything for installations using PECL memcache. After a bunch of trial and error I determined that it was easiest to write the script in Python which requires the python-memcached library and is readily available on different OS types and versions.
I also modified the applications/memcached.inc.php and polling/unix-agent.inc.php to accommodate the new script. They will also accurately separate different instances of memcached running on the same server as reported by the script.
I'm still trying to work out a couple things. The main thing is when you enable Memcached as an application for a device Observium automatically creates an entry in the database but the instance is NULL. When the unix-agent reports on the Memcached instance(s) running on the server new entries get created in the database for each instance and the app with the NULL app_instance never gets used. I've been manually removing it from the database. If possible I would like to work it out so that it doesn't get created automatically. If that's not possible I was going to look into updating that entry with the first real instance reported by the agent.
Also wanting to get the Apps tab for the Device to better identify each instance and maybe work on some additional metrics reporting for Memcached specific stats.
Patch attached, let me know if it is acceptable or not...
Britt Treece _______________________________________________ observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
minor fix that makes a big difference in the script working... der,
On Sat, Jun 1, 2013 at 3:41 AM, Adam Armstrong adama@memetic.org wrote:
Looks fine. The old one wasn't working properly anyways.
Committed in 4091.
adam.
On 2013-05-31 23:19, Britt Treece wrote:
Starting to use Memcached and found some of the current Memcached bits in Observium not working optimally. I wrote a new unix-agent script using python rather than PHP. The previous script relied on PECL memcached but didn't do anything for installations using PECL memcache. After a bunch of trial and error I determined that it was easiest to write the script in Python which requires the python-memcached library and is readily available on different OS types and versions.
I also modified the applications/memcached.inc.php and polling/unix-agent.inc.php to accommodate the new script. They will also accurately separate different instances of memcached running on the same server as reported by the script.
I'm still trying to work out a couple things. The main thing is when you enable Memcached as an application for a device Observium automatically creates an entry in the database but the instance is NULL. When the unix-agent reports on the Memcached instance(s) running on the server new entries get created in the database for each instance and the app with the NULL app_instance never gets used. I've been manually removing it from the database. If possible I would like to work it out so that it doesn't get created automatically. If that's not possible I was going to look into updating that entry with the first real instance reported by the agent.
Also wanting to get the Apps tab for the Device to better identify each instance and maybe work on some additional metrics reporting for Memcached specific stats.
Patch attached, let me know if it is acceptable or not...
Britt Treece ______________________________**_________________ observium mailing list observium@observium.org http://postman.memetic.org/**cgi-bin/mailman/listinfo/**observiumhttp://postman.memetic.org/cgi-bin/mailman/listinfo/observium
______________________________**_________________ observium mailing list observium@observium.org http://postman.memetic.org/**cgi-bin/mailman/listinfo/**observiumhttp://postman.memetic.org/cgi-bin/mailman/listinfo/observium
Tom, et al.
I think perhaps my explanation of the problem was incorrect. I agree that the check_mk agent automatically picks up executable application scripts in the local directory on the remote server. What I'm trying to work out is what Observium does when it either detects new data from the unix-agent and enables the application or when you enable the application manually from the Applications tab in Settings for the device.
Using memcached as an example when you manually enable the Memcached application in settings or when Observium polls a new instance it automatically inserts a row in the database with a NULL app_instance. Then on the next pass of unix-agent.inc.php the NULL app_instance is ignored because an actual app_instance is specified from the script (exa 127.0.0.1:11211). The NULL version never gets updated so I usually manually delete it from MySQL.
So what I am trying to figure out is the best way to enable an multi-instance app such that we aren't left with NULL detritus in the database? I thought about adding logic to memcached.inc.php that would look for a NULL app_instance row and update that row with the new instance data rather than inserting a new row for that instance. This would have the least impact overall. However, other multi-instance applications such as Varnish would also need this exception so I wonder if a row should be inserted at all when an application is enabled...
Thoughts?
Britt
On Sat, Jun 1, 2013 at 4:19 PM, Britt Treece britt.treece@gmail.com wrote:
minor fix that makes a big difference in the script working... der,
On Sat, Jun 1, 2013 at 3:41 AM, Adam Armstrong adama@memetic.org wrote:
Looks fine. The old one wasn't working properly anyways.
Committed in 4091.
adam.
On 2013-05-31 23:19, Britt Treece wrote:
Starting to use Memcached and found some of the current Memcached bits in Observium not working optimally. I wrote a new unix-agent script using python rather than PHP. The previous script relied on PECL memcached but didn't do anything for installations using PECL memcache. After a bunch of trial and error I determined that it was easiest to write the script in Python which requires the python-memcached library and is readily available on different OS types and versions.
I also modified the applications/memcached.inc.php and polling/unix-agent.inc.php to accommodate the new script. They will also accurately separate different instances of memcached running on the same server as reported by the script.
I'm still trying to work out a couple things. The main thing is when you enable Memcached as an application for a device Observium automatically creates an entry in the database but the instance is NULL. When the unix-agent reports on the Memcached instance(s) running on the server new entries get created in the database for each instance and the app with the NULL app_instance never gets used. I've been manually removing it from the database. If possible I would like to work it out so that it doesn't get created automatically. If that's not possible I was going to look into updating that entry with the first real instance reported by the agent.
Also wanting to get the Apps tab for the Device to better identify each instance and maybe work on some additional metrics reporting for Memcached specific stats.
Patch attached, let me know if it is acceptable or not...
Britt Treece ______________________________**_________________ observium mailing list observium@observium.org http://postman.memetic.org/**cgi-bin/mailman/listinfo/**observiumhttp://postman.memetic.org/cgi-bin/mailman/listinfo/observium
______________________________**_________________ observium mailing list observium@observium.org http://postman.memetic.org/**cgi-bin/mailman/listinfo/**observiumhttp://postman.memetic.org/cgi-bin/mailman/listinfo/observium
participants (3)
-
Adam Armstrong
-
Britt Treece
-
Tom Laermans