I am looking for an epagent to install in RHEL 6.6. I have two versions of vmstat from Community downloads - One is rhelVmstat.pl which gives detailed statistics. Another is vmstat.pl which gives overall statistics.
The output I need is the one given by vmstat.pl but when I execute the script in the command line 'perl vmstat.pl' , it is not exiting unless I terminate it. It keeps printing the output after regular intervals. Is that the expected nature?
Once I installed this plugin in a customer environment - vmstat.pl as a stateless plugin. That time , an issue happened where after a couple of weeks , there were multiple perl processes that got generated and eventually let to OOM.
Is there any newer version of vmstat.pl which gives overall statistcics ?
Yes, the vmstat.pl is designed to be a stateful epagent plug-in so the epagent will spawn a separate unix process that runs the "vmstat 7" command and the internals of the Perl script has a endless while loop to cycle through. During the stateful start up the perl script should generate a PID file for vmstat so when the agent is shut down, the perl script will terminate cleanly.
Highly suggest that you look at the df.pl Perl script and break down the perl syntax to build a version of vmstat that is stateless. So basically run the "vmstat" command without the interval "7" value and then parse the return data stream.
Depending on the resolution of metrics you need, the stateless option might be best, but if you need more than one measurement per 15 seconds, then a stateful is the way to go.
Hope this helps,
Is Billy's answer sufficient or do you need additional assistance?
The original vmstat.pl was written for UNIX systems, such as AIX and HPUX.
The newer one for RHEL was written by me specifically for RHEL. Most reasons this is done is due to the formatting of the output. This varies from system to system so it's easier to just write a new one.
For a few years we are using the vmstat.pl on Solaris and RHEL. However, in the past months on some rhel 6.6 servers the support team observed the EPAs were crashing after many days/weeks of operation which appears to be linked the vmstat.
[Fatal Error] :1:54: XML document structures must start and end within the same entity.
7/10/15 01:22:26 EDT [ERROR] [EPAgent] Metric data from plugin 'Plugin VMSTAT' is invalid: <metric type="IntCounter" name="vmstat|Kernel Threads
So the question: in your experience of testing various pluggings, have you observed some issues alike when the epa has a ?hiccup? and/or the script does not terminate the xml properly?
can you post or email the log (to Hiko and me)?
Hiko_Davis, are your EPA scripts here in the community? Does it make sense to put them on GitHub? With a branch per OS?
My script that I wrote for RHEL specifically is in the community documents.
The FATAL is only one line after the startup banner. It does not have a timestamp so we correlated it to that vmstat based on the message look. I do not have access to the prod hosts and cannot duplicate the problem - so still a guessing game. I suggested to edit the config and remove the execution of vmstat ~ now waiting.
Btw: Haruhiko's is vmstat -s vs vmstat -7 and shows different data albeit stateless. The -7 data is more interesting to us.
Let me know if you need me to alter the rhelVmStat.pl. I can't vouch for how the other plugin will behave as it was written a long time ago and was essentially written for UNIX systems (AIX, HP UX, Solaris).