I want to only print server name as header and whatever sas service is not up inside it.if everything is up inside server it should not be printed.
File content-
he2unix554 Server:
SAS servers status:
SAS OLAP Server 1 is UP
SAS Object Spawner 1 is UP
SAS CONNECT Spawner 1 is NOT up
SAS Environment Manager Agent is NOT up
he2unix555 Server:
SAS servers status:
SAS OLAP Server 1 is UP
SAS Object Spawner 1 is UP
SAS CONNECT Spawner 1 is NOT up
SAS Environment Manager Agent is UP
he2unix556 server:
SAS servers status:
SAS OLAP Server 1 is UP
SAS Object Spawner 1 is UP
SAS CONNECT Spawner 1 is UP
SAS Environment Manager Agent is NOT up
he2unix557 Server
SAS servers status:
SAS OLAP Server 1 is NOT up
SAS Object Spawner 1 is UP
SAS CONNECT Spawner 1 is UP
SAS Environment Manager Agent is UP
he2unix558 Server
SAS Web Infrastructure Data Server is UP
SAS OLAP Server 1 is UP
SAS Object Spawner 1 is UP
SAS DIP Job Runner 1 is UP
SAS CONNECT Spawner 1 is UP
SAS Cache Locator Service ins_41415 is NOT up
SAS Environment Manager Agent is NOT up
he2unix559 Server
SAS OLAP Server 1 is UP
SAS Object Spawner 1 is UP
SAS CONNECT Spawner 1 is UP
SAS Environment Manager Agent is UP
Desired Output-
he2unix554 Server:
SAS CONNECT Spawner 1 is NOT up
SAS Environment Manager Agent is NOT up
he2unix555 Server:
SAS CONNECT Spawner 1 is NOT up
he2unix556 server:
SAS Environment Manager Agent is NOT up
he2unix557 Server:
SAS OLAP Server 1 is NOT up
he2unix558 Server:
SAS Cache Locator Service ins_41415 is NOT up
i tried below which is giving me server header even if everything is up inside it.
sed -n '/^he2unix5/ { p } ; /NOT up$/ { p }' sasserverstatus.log
he2unix554 Server:
SAS CONNECT Spawner 1 is NOT up
SAS Environment Manager Agent is NOT up
he2unix555 Server:
SAS CONNECT Spawner 1 is NOT up
he2unix556 server:
SAS Environment Manager Agent is NOT up
he2unix557 Server:
SAS OLAP Server 1 is NOT up
he2unix558 Server:
SAS Cache Locator Service ins_41415 is NOT up
**he2unix559 Server:** #don't want this in output