Forum Replies Created
-
AuthorPosts
-
ShwetanjaliParticipant
Hi,
Thanks for your response. For now, my purpose can be solved just by using queries like “Get-WmiObject -Class Win32_Product”.
I found a script within OCP which can actually serve my purpose-“shared.shell_OS_software_packages.py”However, the job (shared.powershell_OS_software_packages.json) for running the script has trigger point in the format-
“triggerType” : “date”,
“triggerArgs” : {
“run_date” : “2018-06-05 11:58:00”I changed it to the format-
“triggerType” : “interval”,
“triggerArgs” : {
“weeks” : null,
“days” : null,
“hours” : null,
“minutes” : null,
“seconds” : 15,
“start_date” : “”,
“end_date” : “”
}But the job didn’t run. Could you please advice, how can I run this job so that I can get output from it. If I am not wrong the api to get this data would be- …/ocp/data/SoftwarePackage
ShwetanjaliParticipantThanks for your response.
Yes, I actually need CPU/Memory/Disk type information for all discovered endpoints other than just client. As you mentioned, I may need to create a job- my question is- Isn’t there any job already which can get CPU/Memory type for all discovered points? If not, is there any doc available that I can study to create required job because I am new to ITSM work.ShwetanjaliParticipantHi,
I could get the maximum information from the CMS Construct REST API page. However, I cannot get configuration info about the various nodes which I get through find jobs (eg: nodes within the Realmscope: 192.168.0.1 – 192.168.0.254).
By configuration info I mean, the info which we get about the client machine through GET API- “http://localhost:52707/ocp/config/client/MyDesktop”. The response to this API gives following info about client machine- platformType, platformMachine, platformVersion, cpuType, cpuCount, memoryTotal
I require similar information for the other nodes also. Is there any payload that I can use with API- “/query/this” to get the required information.
Could you please guide me through it.ShwetanjaliParticipantSince my OCP server and both ContentGatheringClient and ResultProcessingClient are running on same machine(192.168.0.85-Alle-MonSrv01), so I tried running this API “http://localhost:52707/ocp/config/client/Alle-MonSrv01” to get client information. This API is working fine as I got the required O/P. The issue is with “Find” jobs which I believe are necessary for doing asset management and I cannot figure out how to resolve this issue.
O/P from above API for reference-
{
“endpointName”: “Alle-MonSrv01”,
“platformType”: “Windows-10-10.0.17763-SP0”,
“platformSystem”: “Windows”,
“platformMachine”: “AMD64”,
“platformVersion”: “10.0.17763”,
“cpuType”: “Intel64 Family 6 Model 62 Stepping 4, GenuineIntel”,
“cpuCount”: “2”,
“memoryTotal”: “5 GB”,
“health”: {
“ContentGatheringClient”: [
{
“last_system_status”: “2021-02-10 02:42:38”,
“cpu_avg_utilization”: “42.1”,
“memory_aprox_total”: “5 GB”,
“memory_aprox_avail”: “490 MB”,
“memory_percent_used”: “92.0”,
“process_cpu_percent”: “0.0”,
“process_memory”: “101810176”,
“process_start_time”: “2021-02-10 00:43:36”,
“process_run_time”: “01:59:01”,
“object_id”: “0ce0e30b0d4f4a55ba4b6ed86cc289d6”,
“name”: “Alle-MonSrv01-1”
}
],
“ResultProcessingClient”: [
{
“last_system_status”: “2021-02-10 02:42:36”,
“cpu_avg_utilization”: “41.3”,
“memory_aprox_total”: “5 GB”,
“memory_aprox_avail”: “489 MB”,
“memory_percent_used”: “92.0”,
“process_cpu_percent”: “0.0”,
“process_memory”: “78688256”,
“process_start_time”: “2021-02-09 22:04:34”,
“process_run_time”: “04:38:01”,
“object_id”: “5660962e61e74f3ba6d96c57eef9a8f7”,
“name”: “Alle-MonSrv01-1”
}
],
“UniversalJobClient”: []
}
}ShwetanjaliParticipantHi
I have followed each step as you suggested. I have set “connectViaFQDN” to true, then also changed the firewall settings as suggested.
Then on I opened powershell as admin and ran following commands-
PS C:\> WinRM quickconfig -force
WinRM service is already running on this machine.
WinRM is already set up for remote management on this computer.
PS C:\> Enable-PSRemoting
PS C:\> Set-Item WSMAN:\Localhost\Client\TrustedHosts -Value “192.168.0.*” -Force
PS C:\> Get-Item WSMan:\Localhost\Client\TrustedHostsWSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Client
Type Name SourceOfValue Value
—- —- ————- —–
System.String TrustedHosts 192.168.0.*PS C:\> $c = Get-Credential
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential
PS C:\> $s = New-PSSession -ComputerName “192.168.0.85” -Credential $c
PS C:\> Invoke-Command -Session $s -ScriptBlock {hostname}
Alle-MonSrv01
Still logs show the same result and I am not getting required o/p with APIs.ShwetanjaliParticipantHi,
I tried enabling PowerShell as you suggested and got this o/p – WinRM service is already running on this machine.\n WinRM is already set up for remote management on this computer.
But the logs still showed the same error.
I even tried running New-PSSession command for the same machine where contentGathering client(ip-192.168.0.85, name-Alle-MonSrv01) is running. On PowerShell, the output for the command- “New-PSSession -ComputerName Alle-MonSrv01” was
Id Name ComputerName ComputerType State ConfigurationName Availability
— —- ———— ———— —– —————– ————
19 WinRM19 Alle-MonSrv01 RemoteMachine Opened Microsoft.PowerShell AvailableHowever, for the same machine, contentGatheringJobStatus logs showed-
2021-02-09 05:38:35.121707 info find_PowerShell_test, {‘data’: {‘address’: ‘192.168.0.85’, ‘realm’: ‘default’}, ‘class_name’: ‘IpAddress’, ‘identifier’: ‘79925c9ed19d4a48b2f059e94571bafc’, ‘label’: ‘IpAddress’}, 2021-02-09 05:38:33.982079, 2021-02-09 05:38:35.121706, FAILURE, {‘New-PSSession : [192.168.0.85] Connecting to remote server 192.168.0.85 failed with the following error message :\nAccess is denied. For more information, see the about_Remote_Troubleshooting Help topic.\nAt line:1 char:6\n+ $s = New-PSSession -ComputerName “192.168.0.85” -Credential $ocpc; $?\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+ CategoryInfo : OpenError: (System.Manageme….RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin\ngTransportException\n+ FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed’}, {}ShwetanjaliParticipantHi,
The issue is not just one endpoint. For other endpoints either I am getting the above error or a WARNING.
This time instead of entering the entire IP range, I tried by adding just one IP-192.168.6.41.
Job “find_ICMP_socket_test” ran successfully.
2021-02-08 03:08:18.290569 info find_ICMP_socket_test, {‘value’: ‘192.168.6.41’}, 2021-02-08 03:08:18.270571, 2021-02-08 03:08:18.289568, SUCCESS, {‘IpAddress’: 1}
But with job “find_PowerShell_test” gave following WARNING.
2021-02-08 09:48:55.354664 info find_PowerShell_test, {‘data’: {‘address’: ‘192.168.6.41’, ‘realm’: ‘default’}, ‘class_name’: ‘IpAddress’, ‘identifier’: ‘909e306c6fa549dfb8111d027322563a’, ‘label’: ‘IpAddress’}, 2021-02-08 09:48:53.350975, 2021-02-08 09:48:55.354663, WARNING, {‘Endpoint not listening on ports [5985, 5986]; skipping PowerShell attempt.’}, {}Hence, getting no results with API-http://localhost:52707/ocp/job/runtime/contentGathering/shared.shell_OS_create_config_group
For the machine 192.168.6.41, the admin has freed the ports 5985,5986 and also on the machine where OCP server is running. But still the warning persists.
ShwetanjaliParticipantI am working with OCP admin console. I have entered the network IP Range for which I want to perform content gathering job. I have followed the steps on page-https://www.opencontentplatform.org/get-started/. The logs are getting generated. However I am getting a blank screen for the “Find endpoints” query available in Data-Content-Simple Queries section (the graph-like diagram is not visible).
ShwetanjaliParticipantHi,
Thank you! yes, I was running the wrong command. “framework\openContentPlatform.py” worked.:)
ShwetanjaliParticipantHi,
Thanks for your help, I could install OCP server and also admin on my local laptop. Also, I would like to inform you, that I had installed Source code zip file for OCP from https://github.com/opencontentplatform/ocp/releases/tag/v2.1 and I got a syntax error in file- .\openContentPlatform\framework\database\initializeDatabase.py. I believe it was between lines 232- 235, a comma was missing between the dictionary keys.
I have an another issue now :P. I am trying to install OCP on one of my organization’s server. I have followed exact same steps as I did while installing OCP on my local laptop. After entering all the details for database server-
databaseServer [IP]: IP
databasePort [5432]: 5432
databaseName [postgres]: postgres
databaseUser [postgres]: postgres
databasePassword:
Retype password:
I get this error- server.Exception in configureDatabase: (psycopg2.OperationalError) could not translate host name “IP” to address: Unknown host
(Background on this error at: http://sqlalche.me/e/13/e3q8)Could you please help me resolve it.
ShwetanjaliParticipantHello,
Thanks for the response.
As you mentioned, I have checked the settings in ./conf/ocpSettings.json (admin console directory) and ./conf/globalSettings.json(OCP directory) and these match.
When I run the command- > python .\adminConsole.py
The output is-
Checking browser emulation setting in registry
Key already found with value: (11001, 4). Leaving key unchanged.
Then instead of opening up the admin console, I get the error as mentioned above.ShwetanjaliParticipantHi
I was able to install OCP yesterday by running command- [python D:\Software\openContentPlatform\framework\lib\platformConfig.py] on Anaconda prompt. I followed steps on the install page-(https://www.opencontentplatform.org/install/). I was asked to enter User, Owner and API key and then for some access criteria, to which I gave ‘1’ for all three access permissions. After that the message was something like- server has started and few more lines.Today I tried to install admin console after updating “apiUser” and “apiKey” in ocpSettings.json, but got error-
Checking browser emulation setting in registry
Key already found with value: (11001, 4). Leaving key unchanged.
Exception in main: [‘Traceback (most recent call last):\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\urllib3\\connection.py”, line 159, in _new_conn\n (self._dns_host, self.port), self.timeout, **extra_kw)\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\urllib3\\util\\connection.py”, line 80, in create_connection\n raise err\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\urllib3\\util\\connection.py”, line 70, in create_connection\n sock.connect(sa)\n’, ‘ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it\n’, ‘\nDuring handling of the above exception, another exception occurred:\n\n’, ‘Traceback (most recent call last):\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\urllib3\\connectionpool.py”, line 600, in urlopen\n chunked=chunked)\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\urllib3\\connectionpool.py”, line 354, in _make_request\n conn.request(method, url, **httplib_request_kw)\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\http\\client.py”, line 1244, in request\n self._send_request(method, url, body, headers, encode_chunked)\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\http\\client.py”, line 1290, in _send_request\n self.endheaders(body, encode_chunked=encode_chunked)\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\http\\client.py”, line 1239, in endheaders\n self._send_output(message_body, encode_chunked=encode_chunked)\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\http\\client.py”, line 1026, in _send_output\n self.send(msg)\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\http\\client.py”, line 966, in send\n self.connect()\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\urllib3\\connection.py”, line 181, in connect\n conn = self._new_conn()\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\urllib3\\connection.py”, line 168, in _new_conn\n self, “Failed to establish a new connection: %s” % e)\n’, ‘urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000001A51F2DCA88>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it\n’, ‘\nDuring handling of the above exception, another exception occurred:\n\n’, ‘Traceback (most recent call last):\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\requests\\adapters.py”, line 449, in send\n timeout=timeout\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\urllib3\\connectionpool.py”, line 638, in urlopen\n _stacktrace=sys.exc_info()[2])\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\urllib3\\util\\retry.py”, line 399, in increment\n raise MaxRetryError(_pool, url, error or ResponseError(cause))\n’, “urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=’localhost’, port=52707): Max retries exceeded with url: /ocp/tool/count/IpAddress (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x000001A51F2DCA88>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it’))\n”, ‘\nDuring handling of the above exception, another exception occurred:\n\n’, ‘Traceback (most recent call last):\n’, ‘ File “D:\\admin-console-2.1\\admin-console-2.1\\admin-console\\lib\\main.py”, line 543, in main\n restApi = ocpRestAPI.RestAPI(settings[\’restEndpoint\’], settings[\’restProtocol\’], settings[\’restPort\’], settings[\’restPath\’], settings[\’apiUser\’], settings[\’apiKey\’], verify)\n’, ‘ File “D:\\admin-console-2.1\\admin-console-2.1\\admin-console\\lib\\ocpRestAPI.py”, line 25, in __init__\n self.establishConnection()\n’, ‘ File “D:\\admin-console-2.1\\admin-console-2.1\\admin-console\\lib\\ocpRestAPI.py”, line 36, in establishConnection\n apiResponse = requests.get(testUrl, data=payloadAsString, headers=self.header, verify=self.verify)\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\requests\\api.py”, line 75, in get\n return request(\’get\’, url, params=params, **kwargs)\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\requests\\api.py”, line 60, in request\n return session.request(method=method, url=url, **kwargs)\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\requests\\sessions.py”, line 533, in request\n resp = self.send(prep, **send_kwargs)\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\requests\\sessions.py”, line 646, in send\n r = adapter.send(request, **kwargs)\n’, ‘ File “C:\\Users\\sdubey\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\requests\\adapters.py”, line 516, in send\n raise ConnectionError(e, request=request)\n’, “requests.exceptions.ConnectionError: HTTPConnectionPool(host=’localhost’, port=52707): Max retries exceeded with url: /ocp/tool/count/IpAddress (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x000001A51F2DCA88>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it’))\n”]So my question is, do I need to recreate user and apikey to install the admin console or I can use the same which I created yesterday while installing OCP? If I can use the same, then what am I doing wrong because somehow I cannot install admin console. Although I tried creating user and apikey again today but the cmd exits after it takes input for owner/apikey/access criteria and throws a message “Loading Packages…”
ShwetanjaliParticipantThanks for responding to my query. I followed the steps mentioned in the install page. However, when I try to run python D:\Software\openContentPlatform\framework\lib\platformConfig.py on cmd, I get the error-[Errno 2] No such file or directory: ‘D:\\\\Software\\\\openContentPlatform\\\\conf\\\\databaseSettings.json’\n”]
Could you please help me in resolving this error. The Kafka and postgres are also installed. -
AuthorPosts