03-06-2020, 10:14 AM
(This post was last modified: 03-06-2020, 10:18 AM by troublestarterxxx.)
Hi
I have configured this module :
#SYSTEM SWAPPING
module_begin
module_name Swap
module_type generic_proc
module_exec if [ `free -m | tail -n 1 | awk '{print $3}'` = "0" ]; then echo 1; else echo 0; fi
module_description SWAP OK
module_end
So if swap is used, the value is set to 0 (BAD)
I swap is not used, the value is set to 1 (GOOD)
But when i restart the pandrafms service, always a 0 and a 1 is written in events
![[Image: Image-1.jpg]](https://i.ibb.co/QXwfhN0/Image-1.jpg)
But if you launch manually the command in cli :
if [ `free -m | tail -n 1 | awk '{print $3}'` = "0" ]; then echo 1; else echo 0; fi
The value is always 1.
So why i have 0 in events ??
Thanks for your help
I have configured this module :
#SYSTEM SWAPPING
module_begin
module_name Swap
module_type generic_proc
module_exec if [ `free -m | tail -n 1 | awk '{print $3}'` = "0" ]; then echo 1; else echo 0; fi
module_description SWAP OK
module_end
So if swap is used, the value is set to 0 (BAD)
I swap is not used, the value is set to 1 (GOOD)
But when i restart the pandrafms service, always a 0 and a 1 is written in events
![[Image: Image-1.jpg]](https://i.ibb.co/QXwfhN0/Image-1.jpg)
But if you launch manually the command in cli :
if [ `free -m | tail -n 1 | awk '{print $3}'` = "0" ]; then echo 1; else echo 0; fi
The value is always 1.
So why i have 0 in events ??
Thanks for your help