Page 1 of 1

how can monitor a define service with specific user

Posted: Wed Aug 30, 2017 7:35 am
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

Re: how can monitor a define service with specific user

Posted: Wed Aug 30, 2017 10:02 am
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.

Re: how can monitor a define service with specific user

Posted: Wed Aug 30, 2017 11:29 am
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