Space shortcuts

I have been using an OLD version of Open-Audit for years and love it, but figure it's time to upgrade.

I installed 1.12.10, and after a bit of trial and error, I have managed to get the audit working on my Linux machines...except for a few.

In the audit_linux script, I had to basically comment out any wget commands to just use curl. And since I'm using https, I had to add the -k option. Worked beautifully for most of the servers. The rest of them are giving me the curl error:

Hi Matt,
I'm just finalising our next release and would like this to go in. I know you have this sorted, but what distribution and version were the errors occurring on? I know you said RH6 (above), just confirming those were the machines affected (as opposed to the machines that worked).

2 answers

Thanks Alexander, I'd seen that stackoverflow post,too, but that doesn't do anything for me. All the -s option does here is make it so I don't see the error as well as the progress.

However, I just solved it...and it was that article that got me looking in the right direction.

So when audit.linux.sh runs, the add_system file (that I kept overlooking) that gets created actually told me "Invalid XML". After running the xml file through an online linter, I found that during the Services check, it was checking mysql status, and the init script that was installed from the application was using an old call to "log_success_msg" which was displaying the escape chars that give you the green OK or red Failed. Those were apparently invalid chars. I changed the line in the init script to simply echo "MySQL is running" or "MySQL is not running".

i suspect that your use of curl fails because it expects to work interactively and normally writes to stdout. wget on the other hand usually writes to files. depending on how curl is called (pipeline/backtics etc.) the calling party may very well close whatever filedescriptor curl uses as stdout before curl is done with it, and curl then complains about not being able to write the (response) body. there's a discussion of this aspect on stackoverflow.

my suggestion: change the curl calls to include -s -o /tmp/curltmpfile; -s suppresses the progress bar output, and -o tells it to save any output to the given file.