This script/template allow to "plot" FLEXlm license usage.
I was inspired by "pvenezia" who wrote a FLEXlm license usages using Perl script.
http://forums.cacti.net/viewtopic.php?t ... ght=flexlm
This script run on server_script format. It is written in php. No php dependencies is required for what I know.
This script was a strip down version of a more complex script that I am using in my workplace.
This is the first release version. Please let me know if there is any bug in the script.
This script/library was writtent and test in Linux. Not sure whether will run on Windows.
It is exported using cacti 0.8.7b.
Release Version: 1.0
Date: August 20, 2008, 17:58pm
Created by: Ching Hock Tay
PHP scripts function/purpose
array_to_file.php = Library to write array to file.
flexlm_function.php = Library to access FLEXlm's lmstat.
flexlm_poller_config.php = Configuration file for flexlm_poller.php
flexlm_poller.php = FLEXlm poller itself. Periodically run by cron.d
flexlm_server_config.php = FLEXlm Server Configuration file.
ss_flexlm_lmstat_query.php = Server script file for cacti.
flexlm_poller = Default to run on every 3 minutes.
Server Script's XML file
flexlm_lmstat.xml = Server Script file for cacti to run/access.
Import data query, data_template and graph_templates.
Place all PHP scripts in cacti's script directory. Place the "flexlm_lmstat.xml" in cacti's resource/script_server.
Modify "flexlm_poller_config.php" and "flexlm_server_config.php" to your environment settings.
Modify "flexlm_poller" to your environment and the correct user. Remember that the user must have the write permission to cacti's scripts path.
Place the "flexlm_poller" to the /etc/cron.d path.
Configure cacti for new device. Enter as per normal system but with the follow configuration:
Hostname = FLEXlm license server hostname.
Select SNMP v1.0.
Remove SNMP community name.
Enter the FLEXlm port (e.g. 5280 for Cadence) into the SNMP port instead.
Note: It is possible to assign the result output file to /tmp path but by doing so, require to change "flexlm_poller_config.php" and "ss_flexlm_lmstat_query.php" file.
How it works
flexlm_poller will run on every 3 minutes (depend on the cron configuration). It will poll whatever FLEXlm license servers that is defined in "flexlm_server_config.php". After query all the lmstat result, the contents/result is written to a text file defined by "flexlm_poller_config.php". The format of this result is in php format. When cacti poller is running, the poller will call "ss_flexlm_lmstat_query.php" and this file will "include" the result file. From there, it will display/return back the result to cacti.
The purpose of doing so (include) is to speed up the FLEXlm query during cacti's polling.