> I was more interested in stuff like "LOGGER" to put messages into the system
> log (especially if the log is over on that central administration server)
> and automation tools on that central server to act upon incoming messages is
> adminstrator specified ways.

On the Linux side you need to issue the command "/sbin/halt" as root. In
unix thats 'a process running with uid 0' not neccessarily a root user login
session.

A simple example I'd probably want to review rather harder on a public
network would be something like


int main(int argc, char *argv[])
{

        printf("Content-type: text/plain\n");
        printf("Pragma: no-cache\n");
        printf("Cache-control: no-cache\n\n");

        syslog("%s", "Halt by web client");

        signal(SIGPIPE, SIG_IGN);       // so halt isnt killed in error

        execl("/sbin/halt", "halt", NULL);
}


and shove that in /cgi-bin/admintools/halt.cgi

Create a /cgi-bin/admintools/.htaccess of

AuthUserFile /usr/local/etc/adminpassword
AuthGroupFile /dev/null
AuthName "Admin Tools"
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>




do "htpasswd -c /usr/local/etc/adminpassword username" and set up any
needed user/password pairs.

You can now provide a link to the cgi that should (if I got the above right
from memory) require one of the user/password pairs to run the client
which will print the headers for a text/plain web page followed by any
/sbin/halt output up to the point networking is killed off

If wholesale web based sysadmin appeals to you take a glance at
www.webmin.com


Alan

Reply via email to