0
I have a log file, which has the below lines in it. I need a bash script, which takes the values in Bold (4092.1M / 20.1G) & do the math & then alert from Zabbix
[Eden: 3728.0M(3728.0M)->0.0B(3952.0M) Survivors: 368.0M->144.0M Heap: 4092.1M(48.0G)->144.0M(48.0G)]
[Eden: 3568.0M(3568.0M)->0.0B(3568.0M) Survivors: 528.0M->528.0M Heap: 20.1G(48.0G)->16.7G(48.0G)]
It should warn if the value is more than 30G and it should alert if the value is more than 35G.
Please look for MB / GB as given in the above example. I need to identify which format it is and read the value accordingly.
Can you please help me here
I'm feeling too lazy to code it myself but I'd use awk, extract that field after the Heap keyword, then replace the G by '*1000' & just remove all M's & do the calculation within awk itself. Ought to be no more than a one liner. – curious_cat – 2015-03-11T08:15:10.267