Sapcontrol command execution may come accross issues now and them. FAIL: NIECONN_REFUSED (Connection refused) is one of them. Different situations can triggered this error. The following command examples can overcome the error and bring back the sap control execution to normal.
hatadm@linue7:/usr/sap/HAT/HDB07> sapcontrol -nr 07 -function GetProcessList 11.12.2020 10:14:49 GetProcessList FAIL: NIECONN_REFUSED (Connection refused), NiRawConnect failed in plugin_fopen() # # --------------------------- solutions -------------------------- # # -- check whether the "sapstartsrv" service is running or not # ps -ef | grep sapstartsrv # -- if it is running execute the following command # # --- Solution 1 -- # hatadm@linux7:/usr/sap/HAT/HDB07> sapstartsrv -D pf=/usr/sap/HAT/SYS/profile/HAT_HDB07_linux7 # -- Check sap control is now working # hatadm@linux7:/usr/sap/HAT/HDB07> sapcontrol -nr 07 -function GetProcessList 23.12.2020 11:03:09 GetProcessList OK name, description, dispstatus, textstatus, starttime, elapsedtime, pid hdbdaemon, HDB Daemon, GREEN, Running, 2020 07 10 13:19:31, 3694:43:38, 70739 hdbcompileserver, HDB Compileserver, GREEN, Running, 2020 07 10 13:19:41, 3694:43:28, 71070 hdbindexserver, HDB Indexserver-OPENHR, GREEN, Running, 2020 12 02 18:19:59, 208:43:10, 89178 hdbnameserver, HDB Nameserver, GREEN, Running, 2020 07 10 13:19:31, 3694:43:38, 70768 hdbpreprocessor, HDB Preprocessor, GREEN, Running, 2020 07 10 13:19:41, 3694:43:28, 71072 hdbwebdispatcher, HDB Web Dispatcher, GREEN, Running, 2020 07 10 13:19:55, 3694:43:14, 71844 hdbindexserver, HDB Indexserver-OPENSRCBDD, GREEN, Running, 2020 12 02 18:20:17, 208:42:52, 91465 hdbindexserver, HDB Indexserver-OPENBW, GREEN, Running, 2020 12 02 18:20:28, 208:42:41, 91968 hdbscriptserver, HDB Scriptserver-DEVBW, GREEN, Running, 2020 10 07 09:16:54, 1562:46:15, 135273 # # --- Solution 2 -- # # sapcontrol to start the sap system to be executed with the host option: -host # # sapcontrol -nr
-host :5 13 -function # hatadm@linux7:/usr/sap/HAT/HDB07> sapcontrol -nr 07 -host linux7:50713 -function Start