Hi all,
I'm attempting to monitor some instances of a nearly stock configured memcached with SAM 6 running in an RHEL 6.4 environment, and hitting some befuddling issues with the application monitoring template scripts. Here's an example.
I've set up credentials, discovered a node, and configured the memcached application template for that node with appropriate credentials and port. When the monitor runs, an error is produced with the following output:
Testing on node '172.30.44.211' failed with 'Unknown' status ('Unknown' might be different if script exits with a different exit code).
Output: =====================================================
Illegal division by zero at /tmp/APM_98127686.pl line 59.
I then go over to the SAM Template Editor, and run the memcached "General statistic" component monitor script there, using the same credentials and test node. I receive the same error.
Next, I've extracted that component's Script Body, dumped it into /tmp/test.pl, and run it as the same-credentialed user using the command line including correct port configured in the component. The output returned from the script appears correct and like it should be able to be parsed, with no perl "Illegal division by zero" error at all:
[solarwin@solarwindstest tmp]$ perl test.pl 11211
Message.Threads: Used threads: 4
Statistic.Threads: 4
Message.Current_connections: Current connections: 10
Statistic.Current_connections: 10
Message.Total_connections: Total connections: 20
Statistic.Total_connections: 20
Message.Connection_structures: Connection structures: 11
Statistic.Connection_structures: 11
Message.Current_items: Current items: 0
Statistic.Current_items: 0
Message.Total_items: Total items: 0
Statistic.Total_items: 0
Message.Used_for_caching: Used for caching: 0.00 MB
Statistic.Used_for_caching: 0.00
Message.Cache_usage_ratio: Memcache cache usage ratio: 0.00 %
Statistic.Cache_usage_ratio: 0.00
Message.Evictions: Evictions: 0
Statistic.Evictions: 0
Message.Denied_connections: Denied connections: 0
Statistic.Denied_connections: 0
I'm stumped! When I cut, paste, and run the script myself everything is fine. When I hit "Test" and let SAM login and run the script, "Illegal division by zero".