how can monitor a define service with specific user

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
baber
Posts: 295
Joined: Wed Oct 21, 2015 4:39 am

how can monitor a define service with specific user

Post by baber »

Dear all

Hi
i have added a server with name CM to my nagios and it has monitor some metrics such as CPU , memory , url , ... now i want to know how can create a user on nagios that can just monnitor CM server and can just see url ?
BR

Babak
kyang

Re: how can monitor a define service with specific user

Post by kyang »

Hi @baber,

You can refer to another forum post that answers this question.
https://support.nagios.com/forum/viewto ... 34&t=30008

First, you would have to create a user in Core.

Code: Select all

htpasswd -c /root/readuser.txt username
This creates a file in /root called username.txt <--username you create:

Code: Select all

cat /root/username.txt
Cat that file, and append the output to /usr/local/nagios/etc/htpasswd.users (Don't forget to change the username.txt to the one you created.)

Code: Select all

cat /root/username.txt >> /usr/local/nagios/etc/htpasswd.users
Then you have to edit the cgi.cfg file and uncomment the authorized_for_read_only= username <-- add your specific user here
Note: if you want the user to have command access, you have to also add that in the cgi.cfg.

Code: Select all

/usr/local/nagios/etc/cgi.cfg
Then edit your contact.cfg to add in your new user, and finally, you can add that user to the specific host you want him to only view.

Here are the object definitions for Core in case you're wondering how it's set up in the cfg.
https://assets.nagios.com/downloads/nag ... .html#host

Let me know if this helps, and let us know if there are more questions.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: how can monitor a define service with specific user

Post by dwhitfield »

Thanks @kyang!

I think the main thing from that post not already mentioned is the following document (although it is XI, not Core, it should still largely be relevant):
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Locked