fixed wrong socket closing on master
changed plugin output form and interpretation to provide nagios-plugin compability