Hello
Can we see that which user is login on which computer by nagios core?
Regards
Which user is login on which computer
Re: Which user is login on which computer
Sure, but the actual implementation would depend on the authentication method being used (sometimes) as well as the operating system itself (all the time).
Here's an older post I made where I do a Windows-based "logged in users" check via Powershell using and older NSClient++ version as the agent:
https://support.nagios.com/forum/viewto ... 58#p191894
You could expand on that Powershell following the nagios plugin development guidelines if you wanted richer output.
There's a few different options available on the Nagios Exchange as well:
https://exchange.nagios.org/index.php?o ... 0on%20user
Here's an older post I made where I do a Windows-based "logged in users" check via Powershell using and older NSClient++ version as the agent:
https://support.nagios.com/forum/viewto ... 58#p191894
You could expand on that Powershell following the nagios plugin development guidelines if you wanted richer output.
There's a few different options available on the Nagios Exchange as well:
https://exchange.nagios.org/index.php?o ... 0on%20user
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Which user is login on which computer
Thanks for the assist, @mcapra!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Which user is login on which computer
In old post, I copied this script. Can you tell me where I will put this script.
The following powershell script (I named it check_users.ps1) worked against my Windows 7 machine:
Code: Select all
$computername = 'localhost'
$user = Get-WMIObject Win32_Process -filter 'name="explorer.exe"' -computername $ComputerName |
ForEach-Object { $owner = $_.GetOwner(); '{0}\{1}' -f $owner.Domain, $owner.User } |
Sort-Object | Get-Unique
if(!$user) {Write-Host ""}
else {Write-Host $user}
My NSClient++ (0.4.x) command configuration:
Code: Select all
[/settings/external scripts/scripts]
check_users = cmd /c echo scripts\check_users.ps1; exit($lastexitcode) | powershell.exe -command -
I am using NCPA client. How I can use on NCPA?
The following powershell script (I named it check_users.ps1) worked against my Windows 7 machine:
Code: Select all
$computername = 'localhost'
$user = Get-WMIObject Win32_Process -filter 'name="explorer.exe"' -computername $ComputerName |
ForEach-Object { $owner = $_.GetOwner(); '{0}\{1}' -f $owner.Domain, $owner.User } |
Sort-Object | Get-Unique
if(!$user) {Write-Host ""}
else {Write-Host $user}
My NSClient++ (0.4.x) command configuration:
Code: Select all
[/settings/external scripts/scripts]
check_users = cmd /c echo scripts\check_users.ps1; exit($lastexitcode) | powershell.exe -command -
I am using NCPA client. How I can use on NCPA?
Re: Which user is login on which computer
Here's the official documentation for using custom scripts/plugins with NCPA:
https://support.nagios.com/kb/article/n ... a-722.html
It has a section which includes a sample Powershell script. Let us know if some part of that documentation is unclear or isn't working correctly.
https://support.nagios.com/kb/article/n ... a-722.html
It has a section which includes a sample Powershell script. Let us know if some part of that documentation is unclear or isn't working correctly.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Which user is login on which computer
Be sure to check out our Knowledgebase for helpful articles and solutions!