nagios plugins with state files

Dominick Grift domg472 at gmail.com
Thu May 26 11:48:19 UTC 2011



On Thu, 2011-05-26 at 07:33 -0400, Vadym Chepkov wrote:
> Hi,
> 
> There is a series of nagios plugins which have to record previous call's status in a file.
> For example, check_snmp_uptime. It would record the previous uptime of a monitored server into a bdb file and will generate an ERROR state if during a next call uptime was lower then previous.
> Unfortunately, there is no suitable context for files like that. even nagios_system_plugin_tmp_t doesn't fit the bill.

I guess all (or at least the system and services) plugins should be able
to manage nagios_spool_t content:

mkdir ~/mytest; cd ~/mytest;
echo "policy_module(mytest, 1.0.0) gen_require(\` type nagios_spool_t,
nagios_services_plugin_t, nagios_system_plugin_t; ')
manage_dirs_pattern({nagios_services_plugin_t
nagios_services_plugin_t }, nagios_spool_t, nagios_spool_t)
manage_dirs_pattern({nagios_services_plugin_t
nagios_services_plugin_t }, nagios_spool_t, nagios_spool_t)" >
mytest.te; make -f /usr/share/selinux/devel/Makefile mytest.pp
sudo semodule -i mytest.pp
sudo restorecon -R -v /var/spool/nagios

See where that gets you. 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://lists.fedoraproject.org/pipermail/selinux/attachments/20110526/db78b770/attachment.bin 


More information about the selinux mailing list