KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Shell Script: Error: Invalid result (ÿþ2

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
spike05



Joined: 04 May 2015
Posts: 4

PostPosted: Wed Mar 29, 2017 6:55 am    Post subject: Shell Script: Error: Invalid result (ÿþ2 Reply with quote

I've a script that count the number of used citrix licenses.
Code:

$statusOk  = "ScriptRes:Ok:"
$statusBad = "ScriptRes:Bad:"
$Limit = $args[0]
$res = (Get-WmiObject -class "Citrix_GT_License_Pool" -Namespace "root\CitrixLicensing" -ComputerName server |Measure-Object -Property InUseCount -sum).Sum
if ($res -gt $Limit)
{
echo $statusBad$res
}
else
{
echo $statusOk$res
}

The script works in the "Lets try" tab. But when i run it as a normal test i get the error "Error: Invalid result (ÿþ2"

What am i doing wrong?
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Wed Mar 29, 2017 8:03 am    Post subject: Reply with quote

Could you please check if you have
SScript_UseWindowsPipe=0
parameter in [misc] section of your hostmon.ini file?

Try changing it to:
SScript_UseWindowsPipe=1

HostMonitor restart is required.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
spike05



Joined: 04 May 2015
Posts: 4

PostPosted: Wed Mar 29, 2017 8:17 am    Post subject: Reply with quote

Hello,

The SScript_UseWindowsPipe= wasn't present in the file. I added the line
Quote:

[misc]
SScript_UseWindowsPipe=1

and tested with a 1 and a 0 no success

edit:
even something as simple as
Code:
echo "ScriptRes:Ok:Test Ok"

Returns the error
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Wed Mar 29, 2017 8:27 am    Post subject: Reply with quote

Could you give more details:
1. What HostMonitor version do you use?
2. What Windows/Service pack do you use?
3. HostMonitor started as Application or Service?
4. What User account is used for Windows Service (services.msc) and in "Service" page of HostMontor Options dialog (local admin, domain admin, BUILt-IN Administrator)?
5. Could you start simplified script for testing:
Code:
$statusOk  = "ScriptRes:Ok:"
$statusBad = "ScriptRes:Bad:"
$res = "noData"
echo $statusOk$res

What is test Status and Reply with this script?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
spike05



Joined: 04 May 2015
Posts: 4

PostPosted: Wed Mar 29, 2017 8:34 am    Post subject: Reply with quote

1. v10.50
2. running windows 7 enterprise SP1
3. as a service
4. Local system account (administrator) , running as domain admin
5.
Lets try tab
Quote:
[4:33:06 PM] HostMonitor is going to execute "Test" script ...
[4:33:06 PM] Script executed, correct result received:
----------
- Status: Ok
- Reply: noData
----------

Reply from script
Error: Invalid result (ÿþ2
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Wed Mar 29, 2017 2:13 pm    Post subject: Reply with quote

Could you select "Local system account" on Service page of HostMonitor Options dialog and restart HostMonitor service?
Domain admin account can be specified in services.msc
Please note, these changes may affect test items, performing connections to remote systems without explicity specified credentials.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
spike05



Joined: 04 May 2015
Posts: 4

PostPosted: Wed Mar 29, 2017 11:22 pm    Post subject: Reply with quote

I've tried, but i'm getting the error "Unable to start script. A required privilege is not held by the client"
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Thu Mar 30, 2017 3:31 am    Post subject: Reply with quote

Could you assign "Replace a process level token" privilege to your domain admin account on the machine, where HostMonitor is running ("Administrative Tools" -> "Local Security Policy" applet -> "Local Policies" -> "User Rights Assignment")?
If this will not help, switching to Local system account on services.msc should work for you.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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

KS-Soft Forum Index