Hi I need to create my first cgi script to list the services running on a windows server from my nagios box. The windows box has openssh on it.
I have a bash shell, but that doesn't seem to work, so I want to try to do a perl script. Here's my 3 line shell script with 2 lines of comments.
#!/bin/sh
# doit.sh aej 2008-nov-13
ssh winserver01 "sc query" | /usr/local/bin/txt2html
when I run the shell script from command line as the apache user, I see html scroll by - I can pipe it to a file and open that file in firefox or IE. When I enter the path to the doit.sh script in my browser, I get nothing on the page and then in the apache error log, I get.
"malformed header from script. Bad header=<!DOCTYPE html PUBLIC "-//W3C/: doit.sh"
any ideas?
thanks
adam
I have a bash shell, but that doesn't seem to work, so I want to try to do a perl script. Here's my 3 line shell script with 2 lines of comments.
#!/bin/sh
# doit.sh aej 2008-nov-13
ssh winserver01 "sc query" | /usr/local/bin/txt2html
when I run the shell script from command line as the apache user, I see html scroll by - I can pipe it to a file and open that file in firefox or IE. When I enter the path to the doit.sh script in my browser, I get nothing on the page and then in the apache error log, I get.
"malformed header from script. Bad header=<!DOCTYPE html PUBLIC "-//W3C/: doit.sh"
any ideas?
thanks
adam