-
Notifications
You must be signed in to change notification settings - Fork 20
/
SSH - Linux - Service Status.xml
48 lines (48 loc) · 10.2 KB
/
SSH - Linux - Service Status.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<TotalExport sourceSystem="NG">
<Workflows>
<WorkflowInfo Pnumber="15546" Name="SSH - Linux - Service Status" Description="Simple template using the service command to query the status of all available system services using the service command." Xoml="<SequentialWorkflowActivity xmlns="http://schemas.microsoft.com/winfx/2006/xaml/workflow" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="CustomWorkflow" x:Class="WorkflowDesignerControl.CustomWorkflow">
 <StartSSHSession x:Name="ssh_connect" activityLicenseType="1" id="274" name="StartSSHSession" visible="True" disabled="False" isFavorite="False" isJsonValid="True" IsValid="True" Timeout="00:01:00" TimeInSeconds="60" RecoveryMethodSelection="{x:Null}" TargetModuleID="" TargetModuleName="" Path="{x:Null}" DisplayName="Start SSH Session" Description="Starts an SSH session" Port="22" MaxSessionTime="00:10:00" HostId="4" HostName="local shell server" UserName="" Password="" StartSession="SSH" OSType="0" certtype="" certpath="" notes="Initialize SSH session." TypeName="StartSSHSession" label="Start SSH Session" description="Starts an SSH session" />
 <SendSSHCommand x:Name="cmd_service_status" activityLicenseType="1" id="271" name="SendSSHCommand" visible="True" disabled="False" isFavorite="False" isJsonValid="True" IsValid="True" Timeout="00:01:00" TimeInSeconds="60" RecoveryMethodSelection="{x:Null}" TargetModuleID="" TargetModuleName="" Path="{x:Null}" DisplayName="Send SSH Command" Description="Sends a single SSH protocol command to an open SSH session" SessionName="ssh_connect" Comm="service --status-all 2&gt; /dev/null | sed 's/\[ - \]/Down/g' | sed 's/\[ + \]/Up/g' | awk '{ print $2&quot;|&quot;$1 }'" Prompt="" HostId="-1" HostName="" OSType="0" notes="The status command is executed with the --status-all flag to return a list of system services and their corresponding statuses. The 2&gt; /dev/null redirect ignores STDERR output. The results are then piped to a series of sed commands that parse out unwanted characters and then finally piped to awk where the second column is printed before the first column and a tab is added between each." TypeName="SendSSHCommand" label="Send SSH Command" description="Sends a single SSH protocol command to an open SSH session" />
 <ConvertTextToTable x:Name="table_service_status" activityLicenseType="1" id="317" name="ConvertTextToTable" visible="True" disabled="False" isFavorite="False" isJsonValid="True" IsValid="True" Timeout="00:01:00" TimeInSeconds="60" RecoveryMethodSelection="{x:Null}" TargetModuleID="" TargetModuleName="" Path="{x:Null}" DisplayName="Convert Text to Table" Description="Converts a text variable into a table according to predefined column/row delimiters" TheValue="Service Status&#xD;&#xA;%cmd_service_status%" ColumnsSelection="0" ColumnsDelimiterText="|" ColumnsDelimiter="|" ColumnsDelimiterSelection="|" ColumnsRowNumber="1" RowsSelection="1" RowsDelimiterText="" RowsDelimiterSelection="Carriage Return" RowsDelimiter="Carriage Return" notes="Convert command output to table." TypeName="ConvertTextToTable" label="Convert Text to Table" description="Converts a text variable into a table according to predefined column/row delimiters" />
 <TerminateSSHSession x:Name="ssh_disconnect" activityLicenseType="1" id="275" name="TerminateSSHSession" visible="True" disabled="False" isFavorite="False" isJsonValid="True" IsValid="True" notes="End SSH session." Timeout="00:01:00" TimeInSeconds="60" RecoveryMethodSelection="{x:Null}" TargetModuleID="" TargetModuleName="" Path="{x:Null}" DisplayName="" Description="Terminates an SSH session" SessionName="ssh_connect" HostId="-1" HostName="{x:Null}" OSType="0" TypeName="TerminateSSHSession" label="TerminateSSHSession" description="Terminates an SSH session" />
</SequentialWorkflowActivity>" XomlStatus="0" Details="<p>Simple template using the service command to query the status of all available system services using the <strong>service </strong>command.</p><p><br></p><p>This is achieved with the following command:</p><p><br></p><p><strong>service --status-all 2&gt; /dev/null | sed 's/\[ - \]/Down/g' | sed 's/\[ + \]/Up/g' | awk '{ print $2"\t"$1 }'</strong></p><p><br></p><p>...where the <strong>--status-all</strong> flag returns a list of system services and their corresponding statuses. The <strong>2&gt; /dev/null </strong>redirect ignores STDERR output. The results are then piped to a series of <strong>sed </strong>commands that parse out unwanted characters and then finally piped to <strong>awk </strong>where the second column is printed before the first column and a tab is added between each.</p>" DateLic="34385064303975645753487875595347585630595A78516E636E586F6D4F335A58337773526C426F343064564844367062626E5966624B2F76336F414D54563552356976304C496651597575354E536D71505A764F3732586E4832325257496E304977596670514264484E4E336336732B4635745A6F3759326B4645697774776A4A49585257684144573661464F502F5361654A457653377057644D534C564A334170626D386835776C79695A73483749664175546D3849535A79576973556279586E3349644F7077446F59774972514931425446484339524C4C68776D5472386C522F455445724E644F524761724D68355770355A6A4E313949682F6E6861593653714A486E765A4C687864512B586974796549513641415133374D6571452F69777957725A7565777252417071474D4C59496C4A473741566D426978646B" WorkflowType="0" WorkflowFolderId="80" Permissions="<NewDataSet><xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"><xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"><xs:complexType><xs:choice minOccurs="0" maxOccurs="unbounded"><xs:element name="resultSet"><xs:complexType><xs:sequence><xs:element name="Type" type="xs:int" minOccurs="0" /><xs:element name="Number" type="xs:int" minOccurs="0" /><xs:element name="Read" type="xs:boolean" minOccurs="0" /><xs:element name="Write" type="xs:boolean" minOccurs="0" /><xs:element name="Run" type="xs:boolean" minOccurs="0" /><xs:element name="Owner" type="xs:boolean" minOccurs="0" /></xs:sequence></xs:complexType></xs:element></xs:choice></xs:complexType></xs:element></xs:schema><resultSet><Type>1</Type><Number>1</Number><Read>true</Read><Write>true</Write><Run>true</Run><Owner>true</Owner></resultSet></NewDataSet>" ErrorHandling="" CurrentRevisionNumber="1" WorkflowParentId="0" DateCreated="2021-07-22T14:05:20.607" DateCreatedUser="1" DateModified="2021-07-22T14:07:51.143" DateModifiedUser="1" />
</Workflows>
<Objects>
<Hosts>
<Host Hnumber="4" Hname="eyeShare Module" Hdescription="Automatically Created Object" Deleted="0" DeviceType="1" Site="0" IPAddress="" Platform="0" InstanceMode="0" SNMPMIB="" CredentialsInherit="0" ExecutorID="0" AutoCreated="1" IsMasterHost="0" MasterHostId="0" />
</Hosts>
<ErrorHandlers />
<ErrorMessages />
<MessageTemplates />
<Sites />
<Developments />
<Users>
<User Unumber="1" Uname="Admin" FName="Ayehu" LName="Administrator" Email="Admin@localhost.com" Pnumber1="0000000" Pnumber2="0000000" Role="1" Password1="GO4LNahlTb3F0vFFgGrSO1QZfU55fsedFGLbmAcAVmGs4yG3jvClwosEbnNSqR8pE+z/b445CY+uaGNXWXVwTx6azqDPFQ==" Deleted="0" Modulenumber="0" ActiveDirectoryID="" HomePhoneNumber="" WorkPhoneNumber="" MobilePhoneNumber="" ListenerClientIP="" EmployeeNumber="" />
</Users>
<Groups />
<UsersGroupsArray />
<Domains />
<Commands />
<Classifications />
<Incidents />
<TimeFrames />
<Variables />
<Modules />
<Conditions />
<ConditionArrays />
<ConditionObjects />
<SoapWebServices />
<Triggers />
<TriggerConditionArrays />
<LogCategory />
<LogTriggerCategory />
<Schedules />
<CustomActivities />
<ActivitiesSource />
<ScheduleCategoriesRelations />
</Objects>
<ObjectsRelations>
<ObjectRelation ObjectID="1" Type="User" ParentWorkFlowID="15546" />
<ObjectRelation ObjectID="4" Type="Host" ParentWorkFlowID="15546" />
</ObjectsRelations>
<ExportKeys>
<Key name="passPhrase" value="7832664761624D496B477433795A323249616A30626A5379663765474365546950565A626D6B306B4B4D553D" />
<Key name="saltValue" value="4D6776426E73594F4D723453686E636B79456E4D64673D3D" />
<Key name="initVector" value="45453367315568306A6D6A6B4A694E6B3965424A59325077446757696D2B5866736B66714B5653614E714D3D" />
</ExportKeys>
</TotalExport>