of if using PE you can use the now built in agent ...
# puppet
m
of if using PE you can use the now built in agent status check function https://forge.puppet.com/modules/puppetlabs/pe_status_check/readme#fact-agent_status_check