|
View previous topic :: View next topic |
Author |
Message |
bgorton
Joined: 03 May 2019 Posts: 11
|
Posted: Mon Aug 05, 2019 3:18 pm Post subject: Server not found or responding. Error #70: Permission denie |
|
|
I know what the culprit is, but first, let me give you the info:
I am running a VBS HD Script from HostMonitor. If needed, I can post the code I am using. When I run this test against a Windows 7 station, it responds back with the primary Drive Letter, Percentage Free, and (GB Free). For example, C:42%(98.5).
When I run this test on a Windows 10 station, I get "Server not found or responding: Error #70 Permission denied."
I am using the Connection Manager, and I only have one domain account listed that has full Administrative privileges. HostMonitor is installed on a Windows 2008 R2 server, the workstations above are both on the same Domain.
I have verified that WMI is configured on both stations, along with Remote Registry. I can ping both stations by name and IP address. I can browse to each station thru Windows Explorer by name or IP, using the same Domain credentials.
Every Windows 10 station I run this test on replies with the same error. I have even tried putting the FQDN into the test with no change in result.
Any assistance would be much appreciated.
Code: | cmd /c cscript /B /E:VBScript &Script% %Params%
Option Explicit
DIM sCompStatus, sType, sResult, sSyntaxDesc
DIM iThreshold
' *** Default Values & constants
iThreshold =.2
const statusAlive ="scriptRes:Host is alive:"
const statusDead ="scriptRes:No answer:"
const statusUnknown ="scriptRes:Unknown:"
const statusUnknownHost ="scriptRes:Unknown host:"
const statusOk ="scriptRes:Ok:"
const statusBad ="scriptRes:Bad:"
const statusBadContents ="scriptRes:Bad contents:"
const ShowSyntax ="/?"
' *** Parse the command-line arguments, check syntax, & perform necessary type conversions.
Select Case WScript.Arguments.Count
Case 0 ' *** No command line arguments
sCompStatus =ParseArg(".",0)
Case 1 ' *** Argument1 =computer name
sCompStatus =ParseArg(Wscript.Arguments(0),0)
Case 2 ' *** Argument2 =Critical threshold
sCompStatus =ParseArg(Wscript.Arguments(0),0)
iThreshold =ParseArg(Wscript.Arguments(1),1)
Case Else ' *** Maximum is 2 command line parameters - Show syntax
sCompStatus =ParseArg(ShowSyntax,99)
End Select
' *** If parsed arguments are 'bad' pass the results to StdOut
If InStr(sCompStatus,"scriptRes:") Then
WScript.StdOut.Write sCompStatus
ElseIf InStr(iThreshold,"scriptRes:") Then
WScript.StdOut.Write iThreshold
Else
' *** Otherwise call HDFreeTest Function & pass results to StdOut
WScript.StdOut.Write HDFreeTest(sCompStatus, iThreshold)
End if
' ===========End Script===========
'
' --------Functions & Subs--------
Function ParseArg(Arg, ArgNum)
' *** Purpose: Parse command-line arguments & display Syntax rules if necessary
DIM sReply, sSyntaxDesc
const Syntax ="Syntax: CSCRIPT HDFree.VBS {computer_name} {threshold}"
sSyntaxDesc = vbCrLf & "Where: {computer_name} =" & _
"name of a WMI enabled computer (local or remote)" & vbCrLf & _
vbTab & "{threshold} =minimum freespace" & vbCrLf & _
vbTab & vbTab & "An integer value is interpreted as physical size (in GB)" & vbCrLF & _
vbTab & vbTab & "A decimal value or an integer followed by '%%'" & vbCrLF & _
vbTab & vbTab & " is interpreted as a percentage" & vbCrLF & _
vbTab & vbTab & "Defaults: Computer: " & Chr(34) &"." & Chr(34) & _
" (local computer)" & vbCrLF & _
vbTab & vbTab & vbTab & " Threshold: 20%" & vbCrLF & _
"Inspired by Glynn Seymours adaptation of Rob van der Woude's freespace.vbs" & vbCrLf & _
vbTab & "http://www.robvanderwoude.com"
If InStr(Arg, "?") Then ArgNum =99
Select Case ArgNum
Case 0 ' *** sComputer Argument
ParseArg =CStr(Arg)
Case 1 ' *** iThreshold Argument
On Error Resume Next
If IsNumeric(Arg) Then
ParseArg =CSng(Arg)
Elseif InStrRev(Arg,"%")<>0 Then ParseArg =CSng(Trim(Left(Arg,InStrRev(Arg,"%")-1))/100)
Else
ParseArg =statusUnknown & "Syntax: Argument conversion error: " & Arg
On Error Goto 0
Exit Function
End If
If ParseArg <.01 or ParseArg >99 Then _
ParseArg=statusUnknown & "Threshold value out of bounds: " & Arg
On Error Goto 0
Case Else ' *** Display script syntax
ParseArg =statusUnknown & Syntax ' & sSyntaxDesc
' *** -------------------Remove this--^ if you wish to include Syntax Description
End Select
End Function
' --------------------------------
Function HDFreeTest(ArgComp, ArgThold)
' *** Purpose: Query Windows servers (WMI) for available Hard Disk free space
DIM sStatus, sReply
DIM iFree
DIM oWMIService, oItem, aItems
const GB=1073741824
On Error Resume Next
Set oWMIService =Getobject("winmgmts://" & ArgComp & "/root/cimv2")
If Err.Number Then
HDFreeTest =statusUnknownHost & "Server not found or not responding: Error # " & _
CStr(Err.Number) & " " & Err.Description
Exit Function
End If
Set aItems =oWMIService.ExecQuery("Select * from Win32_LogicalDisk where DriveType =3",,48)
If Err.Number Then
HDFreeTest =statusUnknown & "Error # " & CStr(Err.Number) & " " & Err.Description
Exit Function
End If
On Error GoTo 0
sStatus=statusOK
For Each oItem in aItems
If sReply<>"" Then sReply =sReply & ", "
'Calculate volume's percentage free space
iFree =Int(.5+(100 * oItem.FreeSpace / oItem.Size))
' *** If ANY volume falls below the critical threshold, set the AHM status to BAD
' *** then append this volumes free space and free space percentage to the return message
If iThreshold <1 Then
If iFree<iThreshold*100 Then sStatus =statusBad
sReply =sReply & oItem.Name & iFree & "%" & "(" & Round(oItem.FreeSpace / GB,2) & ")"
Else
If Round(oItem.Freespace / GB,2)<iThreshold Then sStatus ="statusBad"
sReply =sReply & oItem.Name & Round(oItem.FreeSpace / GB,2) & "(" &iFree & "%" & ")"
End If
Next
If sReply =Empty Then
HDFreeTest =statusUnknown & "Local Hard Disk(s) not found"
Else
HDFREETest =sStatus & sReply
End If
End Function |
|
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Mon Aug 05, 2019 4:20 pm Post subject: |
|
|
What about built-in Drive Free Space test? Does it work? or returns the same error?
Why you are not using this test? Because it shows disk with lowest amount of free space while you want to see several disks (all disks with free space below limit)?
Quote: | When I run this test on a Windows 10 station, I get "Server not found or responding: Error #70 Permission denied."
I am using the Connection Manager, and I only have one domain account listed that has full Administrative privileges. HostMonitor is installed on a Windows 2008 R2 server, the workstations above are both on the same Domain. |
As I understand "when I run this test on a Windows 10" means script actually running on Windows 2008 R2 (HostMonitor system) but it tries to get data from Windows 10 system (same domain)?
Regards
Alex |
|
Back to top |
|
|
bgorton
Joined: 03 May 2019 Posts: 11
|
Posted: Tue Aug 06, 2019 8:14 am Post subject: |
|
|
When I use the built-in Drive Space test on a Windows 10 station, it returns Error: Access is denied. This station is on our domain.
When I use the built-in Drive Space test on a Windows 7 station, the test runs as designed and returns a value. This station is on the same domain as the Windows 10 station.
Correct, HostMonitor is running on my R2 server, and it is running the test against Windows (7 and 10) stations. The server is on a Workgroup, not on the domain with the computers it is running tests against.
Here is an interesting note: When I run this test against a Windows 10 station not on the domain, but on a Workgroup, the test runs successfully. But in the Connection Manager, the one and only account I have is for our domain account, which does not have any rights over the Workstation computers (it is not added or referenced at all in the Local Computer Users and Groups).
I am able to run other tests against Windows 10, such as CPU Usage, Services running, file availability, etc. And I have not manually added in the test itself what account to use. Everything should be running thru the Connection Manager credentials, if credentials are necessary. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Tue Aug 06, 2019 1:50 pm Post subject: |
|
|
I would recommend to run HostMonitor on domain server or use RMA (Remote Monitoring Agent) started on domain system.
However we tested similar config (HM on non_domain_host, Windows 7 and Windows 10 domain systems) and we cannot reproduce the problem, HostMonitor was able to check Drive Free Space on Windows 7 and Windows 10
May be you are using account without necessary rights?
(theoretically Windows7 and Windows10 require the same set of rights)
Quote: | And I have not manually added in the test itself what account to use. Everything should be running thru the Connection Manager credentials, if credentials are necessary. |
I think if you are using WMI in external script, then you should connect to remote system using specific account (specified in your script).
But in your case this probably will not help..
I think Dominant Process and Memory tests fail as well?
Regards
Alex |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|