Hi,
I have just tried to get a breif status informantion from virtualmin via the remote.cgi interface. I wanted to call the "info" command with the "host" option to limit the output.
Example taken from documentation:
[root@fudu ~]# virtualmin info host host: hostname: fudu.home module root: /usr/local/webadmin/virtual-server os: Redhat Linux Fedora 9 root: /usr/local/webadmin theme version: 6.6 virtualmin version: 3.65 webmin version: 1.449
Call of the info command work ok but when I append the host option I only get "Exit status: 0" as output.
When reviewing the remote.cgi script I realized that the script prepend all options with "--" before calling the relevant perl script. However, the info command only accepts the host option without "--"
I made a workaround by changing the remote.cgi to check whether the option is "host". If so, the script doesn't prepend the "--" and it works!
However, I suggest the the correct fix would be to change info.pl to accept host with "--" as an option.
Regards, Rolf
Example:
[root@fudu ~]# virtualmin info --host host: hostname: fudu.home module root: /usr/local/webadmin/virtual-server os: Redhat Linux Fedora 9 root: /usr/local/webadmin theme version: 6.6 virtualmin version: 3.65 webmin version: 1.449
Comments
Submitted by JamieCameron on Tue, 09/29/2009 - 14:48 Comment #1
Actually, there is already a proper way to get the information you want with the -- flag, like so :
virtualmin info --search host
This is poorly documented though, so I will make it clearer in the next release.
Submitted by openusource on Wed, 09/30/2009 - 04:59 Comment #2
Perfect! Thanks
Submitted by openusource on Wed, 10/14/2009 - 09:34 Comment #3
Ups
gives nothing
However, without "--" I get the output:
... back to square one :-(
Submitted by openusource on Wed, 10/14/2009 - 10:32 Comment #4
First of all, I'm not an Perl expert :-)
However, when studying the info.pl file I noticed that the search option is implemented by pushing the search value on to the @searches array in line 47:
But the shift never happens so what is pushed in the @searches array is "--search". Strange is it that if the @ARGV is shifted before the push is called, like this:
, everything is fine! And "host" (in my example) is pushed in the @searches array.
My perl version is 5.010000.
// Rolf
Submitted by JamieCameron on Wed, 10/14/2009 - 12:42 Comment #5
Doh, you are correct .. I will include this fix in the next Virtualmin release.
Submitted by Issues on Thu, 10/29/2009 - 19:19 Comment #6
Automatically closed -- issue fixed for 2 weeks with no activity.