Nagios deligated admin for hostgroup

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
inas.labib
Posts: 170
Joined: Tue Sep 11, 2012 3:48 am

Nagios deligated admin for hostgroup

Post by inas.labib »

Hello Support,


I want to create some user accounts, each user has its own hostgroup. When they login to their account, they can only view and manage the hosts in their group. How do I do this?

This user can be the Admin to those deligated Hostgroups and they can add new hosts/Remove hosts from this Host groups. Please let us know how we can achieve this.

Requirement scenario: When there is request from Windows team comes in to add/edit a new service to a windows Host. will they be able to do this without requiring a Nagiosadmin. Can this access be delgated only to those windows group wthout affecting other host groups.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios deligated admin for hostgroup

Post by lmiltchev »

You cannot add a contact to a hostgroup, but you could add it to all hosts that are members of the hostgroup.

The easiest way of doing it would be via the Bulk Modifications Tool.

CCM > Tools > Bulk Modifications Tool > Add Contact(s), select your contact, click on "Select Hosts using Host Groups", select your hostgroup > Add Selected > Save Changes, and Apply Configuration.
Be sure to check out our Knowledgebase for helpful articles and solutions!
inas.labib
Posts: 170
Joined: Tue Sep 11, 2012 3:48 am

Re: Nagios deligated admin for hostgroup

Post by inas.labib »

HI Team,

When we tried to execute a powershell script using nsclient we received below error. Attached both nsc and nsclient configuration file

nsclient version: 0.4.3.143. on windows Windows 2012 server

COMMAND: /usr/local/nagios/libexec/check_nrpe -H wp3wcwcf1p3.wdprocessing.sys -p 5666 -t 120 -c check_ms_iis_application_pool -a '-A WCF'
OUTPUT: Unknown command(s): check_ms_iis_application_pool|

Scripts were placed under:
C:\Program Files\NSClient++\scripts

Nsclient log:
2018-12-26 23:29:50: error:D:\source\nscp\include\nscapi\nscapi_core_wrapper.cpp:159: Failed to execute command
2018-12-26 23:29:50: error:D:\source\nscp\include\nscapi\nscapi_core_helper.cpp:95: Failed to execute command: check_ms_iis_application_pool
2018-12-26 23:34:19: error:D:\source\nscp\service\NSClient++.cpp:893: Unknown command(s): check_iis8_connections available commands: commands {, alias_cpu, alias_cpu_ex, alias_disk, alias_disk_loose, alias_event_log, alias_file_age, alias_file_size, alias_mem, alias_process, alias_process_count, alias_process_hung, alias_process_stopped, alias_sched_all, alias_sched_long, alias_sched_task, alias_service, alias_service_ex, alias_up, alias_updates, alias_volumes, alias_volumes_loose, check_always_critical, check_always_ok, check_always_warning, check_counter, check_cpu, check_critical, check_drivesize, check_eventlog, check_files, check_memory, check_multi, check_negate, check_ok, check_os_version, check_pagefile, check_pdh, check_process, check_service, check_timeout, check_uptime, check_version, check_warning, check_wmi, checkalwayscritical, checkalwaysok, checkalwayswarning, checkcounter, checkcpu, checkcritical, checkdrivesize, checkeventlog, checkfiles, checkmem, checkmultiple, checkok, checkprocstate, checkservicestate, checkuptime, checkversion, checkwarning, checkwmi, filter_perf, negate, render_perf, timeout, xform_perf}, plugins {, 0, 1, 2, 3, 4, 5}
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios deligated admin for hostgroup

Post by lmiltchev »

If you are using nsclient version: 0.4.3.143, you shouldn't be having a NSC.ini config file... It's used in older versions of NSClient++, e.g. 0.3.9. As far as your commands:

Code: Select all

[/settings/external scripts/scripts]
check_ms_iis_application_pool=check_ms_iis_application_pool.ps1 $ARG1$
check_iis8_connections=check_iis8_connections.ps1 $ARG1$ '$ARG2$' 500 800
you should probably change them to:

Code: Select all

[/settings/external scripts/scripts]
check_ms_iis_application_pool = cmd /c echo scripts\check_ms_iis_application_pool.ps1 $ARG1$; exit $LastExitCode | powershell.exe -command -
check_iis8_connections =  cmd /c echo scripts\check_iis8_connections.ps1 $ARG1$ '$ARG2$' 500 800; exit $LastExitCode | powershell.exe -command -
Also, you will need to add under the [/settings/external scripts] section:

Code: Select all

allow nasty characters = 1
allow arguments = 1
and restart the nsclient service, so that changes can take effect.
Be sure to check out our Knowledgebase for helpful articles and solutions!
inas.labib
Posts: 170
Joined: Tue Sep 11, 2012 3:48 am

Re: Nagios deligated admin for hostgroup

Post by inas.labib »

Hi,

Thanks for your suggestion, I have reinstalled nsclient 0.4.x version on windows machine and added the nsclinet.ini configuration file as suggested. Im able to execute check_nt commands for default services. But when i tried to execute check_nrpe i get "Socket Timeout error after 10 sec"

The ports were Listening on client machine and im able to telnet from the nagios server on running following commands for default modules
cd "<C:\Program Files\NSClient++>"
nscp settings --generate --add-defaults –load-all

cd "<C:\Program Files\NSClient++>"
nscp settings --activate-module NRPEServer --add-defaults
nscp settings --path /settings/NRPE/server --key "allow arguments" --set true
nscp settings --path /settings/NRPE/server --key "allow nasty characters" --set true
nscp settings --path /settings/NRPE/server --key insecure --set true
nscp settings --path /settings/NRPE/server --key "verify mode" --set none
nscp settings --activate-module CheckExternalScripts --add-defaults
nscp settings --path "/settings/external scripts" --key "allow arguments" --set true
nscp settings --path "/settings/external scripts" --key "allow nasty characters" --set true


Earlier i was getting below error :
Unknown command(s): check_ms_iis_application_pool.ps1

attached the nsclient modified file for your reference
inas.labib
Posts: 170
Joined: Tue Sep 11, 2012 3:48 am

Re: Nagios deligated admin for hostgroup

Post by inas.labib »

HI,

Issue has been fixed thanks
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios deligated admin for hostgroup

Post by lmiltchev »

I am glad your issue has been resolved! I am closing this topic.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked