Saving virtualmin login info to text file

1 post / 0 new
#1 Sun, 11/26/2017 - 11:12

Saving virtualmin login info to text file


I'm trying to find a way save details for every virtualmin successful login. I see a similar topic here, but unfortunately I cannot replicate

The first thing is the login_script parameter already exists in the file /etc/webmin/miniserv.conf, it is login_script=/etc/webmin/, should I add another line login_script=/etc/webmin/ ?

Any way, I tried it, and here is the content if the file


use strict;
use warnings;
use LWP::Simple;

my $filename = "/etc/testing.txt";
open my $fh, ">", $filename or die("Could not open file. $!");
my $xml = $ARGV[0];
print $xml;
print $fh $xml;
close $fh;

$ARGV[0] should be the username as mentioned in the reference link.

After saving the script file and the miniserv.conf file, I restarted webmin. But after logging in, the file /etc/testing.txt is not created.

What would be the reason, and how to fix this? Is there any log file to check any error with the perl scripts?

Thank you very much for any help.