exec_generate_config.php tar usage

Support requests, bug reports, questions etc.
Locked
vbruno
exec_generate_config.php tar usage

Post by vbruno » Thu May 14, 2009 19:45

The tar command usage is not supported on many unix releases. Specifically the "-z" command switch is not supported on many versions of tar. Here is an alternate syntax that I had to use to make it work on Solaris 8.

OLD:

Code: Select all

system("cd ".NCONFDIR."/temp; tar -zcf NagiosConfig.tgz global ".implode(" ", $servers));
UPDATE:

Code: Select all

system("cd ".NCONFDIR."/temp; tar -cf - global ".implode(" ", $servers)." | gzip -c >NagiosConfig.tgz");
In the update command, tar outputs to STDOUT and is then piped into gzip which writes to the file.

User avatar
agargiulo
NConf developer
NConf developer
Posts:725
Joined:Fri Mar 06, 2009 17:50
Location:Zurich, Switzerland
Contact:

Re: exec_generate_config.php tar usage

Post by agargiulo » Fri May 15, 2009 07:27

Hi.

You're absolutely right. This has been changed in release 1.2.5 which is due sometime in the next few weeks.

Regards,
Angelo

Locked