Logged in User details for NCPA(linux\unix)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Logged in User details for NCPA(linux\unix)

Post 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
You do not have the required permissions to view the files attached to this post.
Thanks & Regards,
I2MP Team.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

Post 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
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

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

Post 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.
Thanks & Regards,
I2MP Team.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

Post 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
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

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

Post 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.
Thanks & Regards,
I2MP Team.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

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

Post 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
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

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

Post 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.
Thanks & Regards,
I2MP Team.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

Post by ssax »

This link specifically gives you a plugin and the nsclient commands you should define:

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