cobbler only runs under sudo, so you could add a second set of lines to pull out the hostname and ip addr for a user running the script.