Page 1 of 1

Logged in User details for NCPA(linux\unix)

Posted: Tue Sep 07, 2021 3:15 am
by RIDS_I2MP
Hi Team,

Please let us know if any plugin is available to fetch users logged to a particular server and it should send alert if there name is not present in argument list. This plugin should be for NCPA linux\Aix server.

We have a plugin that does same for NRPE agent. Attaching it can this same plugin work for NCPA to for linux\AIX servers.
If so then what all changes needs to be done. Can you please help us.
show_users.sh
Thanks

Re: Logged in User details for NCPA(linux\unix)

Posted: Tue Sep 07, 2021 4:16 pm
by ssax
You can use the same plugin.

Put the plugin in the /usr/local/ncpa/plugins directory on the system. Then set owner/group/permissions:

Code: Select all

chown nagios.nagios /usr/local/ncpa/plugins/show_users.sh
chmod ug+x /usr/local/ncpa/plugins/show_users.sh
Then test it from the XI server:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H X.X.X.X -t 'yourtoken' -M plugins/show_users.sh -a '-s -m root,someotheraccount'
See here:

https://support.nagios.com/kb/article/n ... a-722.html
https://www.nagios.org/ncpa/help.php#ap ... es-plugins

Then you can add it through the NCPA wizard or manually:

https://assets.nagios.com/downloads/nag ... gement.pdf

Re: Logged in User details for NCPA(linux\unix)

Posted: Tue Sep 14, 2021 3:48 pm
by RIDS_I2MP
Hi ssax,

Thanks for the help solution worked 8-).

Can you please check and let us know if we can use same plugin for NSC client for windows servers also.

If yes please let us know what all changes are needs to be done.

Thanks in advance.

Re: Logged in User details for NCPA(linux\unix)

Posted: Wed Sep 15, 2021 1:44 pm
by ssax
This script should work:

https://support.nagios.com/forum/viewto ... 94#p191894

Put it in this directory on the remote server:

Code: Select all

C:\Program Files (x86)\Nagios\NCPA\Plugins
Call it:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H X.X.X.X -t 'yourtoken' -M plugins/check_users.ps1

Re: Logged in User details for NCPA(linux\unix)

Posted: Wed Sep 15, 2021 4:32 pm
by RIDS_I2MP
The requirement is for NSC client for windows servers. we don't use NCPA to monitor our windows servers.
Can you please help us with a plugin that supports NSC client.

Thanks in advance.

Re: Logged in User details for NCPA(linux\unix)

Posted: Thu Sep 16, 2021 11:10 am
by pbroste
Hello @RIDS_I2MP

Thanks for following up, with the additional info. Appears that you are using NRPE with N and appears that this support article will assist in setting up a PowerShell script that will pull User login from the Event Security log by implementing example to pull info:

Code: Select all

Get-EventLog security | Where-Object {($_.InstanceID -eq 4634) -or ($_.InstanceID -eq 4624)} | Select-Object Index,TimeGenerated,InstanceID,Message
Thanks,
Perry

Re: Logged in User details for NCPA(linux\unix)

Posted: Fri Sep 17, 2021 2:39 pm
by RIDS_I2MP
Hi Team,

It would be great if you can find a script that does the same the work and share it with us.

Thanks in advance.

Re: Logged in User details for NCPA(linux\unix)

Posted: Mon Sep 20, 2021 12:13 pm
by ssax
This link specifically gives you a plugin and the nsclient commands you should define:

https://support.nagios.com/forum/viewto ... 94#p191894