Uhm, the problem is that the nagios class installs nagios and is intended to be used only by the nagios server.
Nagios::target is used on all the monitored nodes and it exports the recources collected on the nagios server according to the nodes settings... For this reason there should not be references to the main nagios class on nagios::target