1

What is the recommended home directory for the nagios user (FHS)?

When I monitor a linux system, I have to create a user for ssh-key-based login and for grating him the needed rights via sudoers.

I found serveral recommendations:

/var/run/nagios3

/var/lib/nagios3

/home/nagios3

What would be the best location in view to the Filesystem Hierarchy Standard?

Randy
  • 190
  • 1
  • 11
  • You don't say what distro you're using. Generally, the nagios package will also create the user, and whatever it creates is likely to be the safest and sanest default. – MadHatter Apr 24 '14 at 11:14
  • I am using debian but my questions is related the Filesystem Hierarchy Standard. When I install the monitoring system (server) it creates a home directory at /var/lib/nagios. But is this also the right location for a system that should be monitored? Where only the plugins are needed? – Randy Apr 24 '14 at 11:21

1 Answers1

2

Nagios doesn't need a certain location. The default is fine. If you change it from the default, you have to ensure the configuration files match. When monitoring a Linux guest all you have to install is nrpe and the defaults for that work fine as well (in my case at least).

Nathan C
  • 14,901
  • 4
  • 42
  • 62
  • In fact the nagios user needs a home directory in which I put the authorized_keys file. I don't use nrpe since I don't trust it for several reasons. – Randy Apr 24 '14 at 13:10
  • Okay...then whatever the `adduser` puts in for a directory is fine. SSH looks at whatever happens to be the user's set home directory. – Nathan C Apr 24 '14 at 13:12
  • I know how to create a user. My question is **which** directory to use as homedirectory to comply with [Filesystem Hierarchy Standard](http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard). The nagios-user is not an individual so it seems not right to put it under /home/ . – Randy Apr 24 '14 at 16:46
  • @Randy Fair enough. `/home/nagios` is the *best* location based on the standard. `/var/run` wouldn't work since it's designed for non-persistent data, and `/var/lib` doesn't make sense because it's not a library. – Nathan C Apr 24 '14 at 16:51
  • This is what I thought in the first place too. _But_ the debian package manager creates a userdirectory for nagios under `/var/lib/nagios` when installing the server side monitoring system (not the system that is to be monitored). – Randy Apr 24 '14 at 16:58
  • @Randy Seems to be specific to Debian. CentOS puts it under `/usr/local/nagios`..so it's all preference. – Nathan C Apr 24 '14 at 17:03
  • `/usr/local/nagios` sounds good :D – Randy Apr 24 '14 at 17:04