You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

Template:Server: Difference between revisions

From Wikitech-static
Jump to navigation Jump to search
imported>Krinkle
No edit summary
imported>Krinkle
No edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 7: Line 7:
{{!}}-
{{!}}-
}}
}}
{{#if: {{{server_group|<noinclude>demo</noinclude>}}}|
{{#if: {{{cluster|{{{server_group|<noinclude>demo</noinclude>}}}}}}|
{{!}} bgcolor=#efefef {{!}} Server&nbsp;group:
{{!}} bgcolor=#efefef {{!}} Cluster:
{{!}} bgcolor=#f8f8ff {{!}} {{{server_group|Example services}}}
{{!}} bgcolor=#f8f8ff {{!}} {{{cluster|{{{server_group|Example services}}}}}}
{{!}}-
{{!}}-
}}
}}
Line 25: Line 25:
{{!}} bgcolor=#efefef {{!}} [[Racktables]] ID:
{{!}} bgcolor=#efefef {{!}} [[Racktables]] ID:
{{!}} bgcolor=#f8f8ff {{!}} #[https://racktables.wikimedia.org/index.php?page=object&object_id={{urlencode:{{{racktables_id}}}}} {{{racktables_id}}}]
{{!}} bgcolor=#f8f8ff {{!}} #[https://racktables.wikimedia.org/index.php?page=object&object_id={{urlencode:{{{racktables_id}}}}} {{{racktables_id}}}]
{{!}}-
}}
{{#if: {{{netbox|}}}|
{{!}} bgcolor=#efefef {{!}} [[Netbox]] ID:
{{!}} bgcolor=#f8f8ff {{!}} #[https://netbox.wikimedia.org/dcim/devices/{{urlencode:{{{netbox}}}}}/ {{{netbox}}}]
{{!}}-
{{!}}-
}}
}}
Line 31: Line 36:
{{!}} bgcolor=#f8f8ff {{!}} {{#if: {{{usage-multi|}}}
{{!}} bgcolor=#f8f8ff {{!}} {{#if: {{{usage-multi|}}}
  | {{{usage-multi}}}
  | {{{usage-multi}}}
  | {{#ifeq: {{lc:{{{status|unknown}}}}} | decommissioned
  | {{#ifeq: {{lc:{{{status|}}}}} | decommissioned
   | {{{usage|unknown}}}
   | {{{usage|unknown}}}
   | {{Server/usage|{{#if:{{{usage|}}}|{{{usage|}}}|{{#if:{{{server_group|}}}|{{{server_group}}}|unknown}}}}}}
   | {{Server/usage|{{#if:{{{usage|}}}|{{{usage|}}}|{{#if:{{{cluster|{{{server_group|}}}}}}|{{{cluster|{{{server_group}}}}}}|unknown}}}}}}
   }}
   }}
}}
}}
Line 41: Line 46:
|-
|-
| bgcolor=#efefef {{!}} Overall:
| bgcolor=#efefef {{!}} Overall:
| bgcolor=#f8f8ff {{!}} {{Server/status|{{{status|unknown}}}}}
| bgcolor=#f8f8ff {{!}} {{Server/status|{{{status|<noinclude><!-- demo -->online</noinclude>}}}}}
|-
|-
{{#if: {{{server_group|<noinclude>demo</noinclude>}}}|
{{#if: {{{server_nodename|<noinclude>demo</noinclude>}}}|
{{#ifeq: {{lc:{{{status|unknown}}}}} | decommissioned ||
{{!}} bgcolor=#efefef {{!}} Ganglia<sup>[[Ganglia|?]]</sup>:
{{!}} bgcolor=#f8f8ff {{!}} {{Ganglia
  | cluster = {{{server_group|Example services}}}
  | node = {{{server_nodename|foo.examplenet}}}
  }} <includeonly>[[Category:Server group:{{{server_group}}}|{{{server_nodename}}}]]</includeonly>
{{!}}-
}}
}}
}}
| bgcolor=#efefef {{!}} Icinga<sup>[[Icinga|?]]</sup>:
| bgcolor=#efefef {{!}} Icinga<sup>[[Icinga|?]]</sup>:
| bgcolor=#f8f8ff {{!}} [https://icinga.wikimedia.org/cgi-bin/icinga/extinfo.cgi?type=1&host={{urlencode:{{#if: {{{name|}}} | {{{name}}} | {{lcfirst:{{PAGENAME}}}} }}}} host status] [https://icinga.wikimedia.org/cgi-bin/icinga/status.cgi?host={{urlencode:{{#if: {{{name|}}} | {{{name}}} | {{lcfirst:{{PAGENAME}}}} }}}}&nostatusheader services status]
| bgcolor=#f8f8ff {{!}} [https://icinga.wikimedia.org/cgi-bin/icinga/extinfo.cgi?type=1&host={{urlencode:{{#if: {{{name|}}} | {{{name}}} | {{lcfirst:{{PAGENAME}}}} }}}} host status] [https://icinga.wikimedia.org/cgi-bin/icinga/status.cgi?host={{urlencode:{{#if: {{{name|}}} | {{{name}}} | {{lcfirst:{{PAGENAME}}}} }}}}&nostatusheader services status]
Line 85: Line 78:
{{!}} bgcolor=#efefef {{!}} Kernel:
{{!}} bgcolor=#efefef {{!}} Kernel:
{{!}} bgcolor=#f8f8ff {{!}} {{{kernel}}}
{{!}} bgcolor=#f8f8ff {{!}} {{{kernel}}}
{{!}}-
}}
{{#if: {{{usage_version|}}}|
{{!}} bgcolor=#efefef {{!}} {{{usage}}}&nbsp;version:
{{!}} bgcolor=#f8f8ff {{!}} {{{usage_version}}}
{{!}}-
{{!}}-
}}
}}
|}<includeonly><!--
|}<includeonly><!--
   Automatically insert display title modification if the name of the server is lcfirst of the page name
   Automatically insert display title modification if the name of the server is lcfirst of the page name
-->{{#ifeq: {{lcfirst:{{PAGENAME}}}} | {{Server/name|{{{name|}}}}} | {{DISPLAYTITLE:{{Server/name|{{{name|}}}}}}} }}<!--
-->{{#ifeq: {{lcfirst:{{PAGENAME}}}} | {{Server/name|{{{name|}}}}} | {{DISPLAYTITLE:{{#if:{{NAMESPACE}}|{{NAMESPACE}}:|}}{{Server/name|{{{name|}}}}}}} }}<!--
   Categories:
   Categories:
-->[[Category:{{Server/location|{{{location}}}}} cluster]]<!--
-->[[Category:{{Server/location|{{{location}}}}} data center]]<!--
-->[[Category:Servers]]<!--
-->[[Category:Servers]]<!--
--></includeonly><noinclude><div style="clear: both;"></div>
--></includeonly><noinclude><div style="clear: both;"></div>
Line 103: Line 91:
This template categorizes the host page into:
This template categorizes the host page into:
* [[:Category:Servers]]
* [[:Category:Servers]]
* a subcategory of [[:Category:Clusters]] (based on the <tt>{{{location}}}</tt> parameter)  
* a subcategory of [[:Category:Data centers]] (based on the <tt>{{{location}}}</tt> parameter)  
* a subcategory of [[:Category:Servers by usage]] (based on the <tt>{{{usage}}}</tt>)
* a subcategory of [[:Category:Servers by usage]] (based on the <tt>{{{usage}}}</tt>)
* a subcategory of [[:Category:Servers by status]] (based on the <tt>{{{status}}}</tt>)
* a subcategory of [[:Category:Servers by status]] (based on the <tt>{{{status}}}</tt>)
* a subcategory of [[:Category:Servers by group]] (based on the <tt>{{{server_group}}}</tt>/<tt>{{{server_nodename}}}</tt>)


==Parameters==
==Parameters==
;location: (required) Which [[:Category:Clusters|cluster]] this server is located in.
;location: (required) Which [[:Category:Data centers|data center]] this server is located in.
;name: (optional: defaults to <tt><nowiki>{{PAGENAME}}</nowiki></tt>
;name: (optional: defaults to <tt><nowiki>{{PAGENAME}}</nowiki></tt>
;serial: (optional)
;serial: (optional)
;usage: (optional) ID of usage (see [[Category:Servers by usage]] for possible values)
;usage: (optional) ID of usage (see [[:Category:Servers by usage]] for possible values)
;usage-multi: (optional) Overwrites <code>usage</code> for embedding multiple templates directly.
;usage-multi: (optional) Overwrites <code>usage</code> for embedding multiple templates directly.
;status: (optional) Use <code>online</code>, <code>offline</code>, <code>unknown</code> or <code>decommissioned</code> (see [[Template:Server/status]])
;status: (optional) Use <code>active</code> or <code>decom</code> (see [[Template:Server/status]])
;memory: (optional)
;memory: (optional)
;cpu: (optional)
;cpu: (optional)
Line 120: Line 107:
;os: (optional)
;os: (optional)
;kernel: (optional)
;kernel: (optional)
;usage_version: (optional)
;cluster: (optional) Name of organizational server group (not physical per se).
;server_group: (optional) Name of organizational server group (not physical per se). Should match the "Source" group of the node in Ganglia (passed to {{tl|Ganglia}})
;server_nodename: (optional) "Node" hostname.
;server_nodename: (optional) "Node" hostname. Should match the "Node name" in Ganglia (passed to {{tl|Ganglia}})
;racktables_id: (optional) The "object_id" of the server in [[Racktables]]
;racktables_id: (optional) The "object_id" of the server in [[Racktables]]
;netbox: (optional) The "object_id" of the server in [[Netbox]]


<templatedata>
<templatedata>
Line 136: Line 123:
"location": {
"location": {
"label": "Location",
"label": "Location",
"description": "Which cluster this server is located in.",
"description": "Which data center this server is located in.",
"example": "eqiad",
"example": "eqiad",
"type": "string",
"type": "string",
Line 150: Line 137:
"status": {
"status": {
"label": "Status",
"label": "Status",
"description": "Use one of \"online\", \"offline\", \"unknown\" or \"decom\"",
"description": "Use one of \"active\", or \"decom\"",
"type": "string",
"type": "string",
"default": "unknown"
"default": "active"
},
"cluster": {
"aliases": [
"server_group"
],
"label": "Cluster",
"type": "string"
}
}
},
},
Line 159: Line 153:
"location",
"location",
"status",
"status",
"usage"
"usage",
"cluster"
],
],
"format": "block"
"format": "block"
Line 169: Line 164:
| location =  
| location =  
| name =  
| name =  
| racktables_id =  
| netbox =  
| usage =  
| usage =  
| status = online
| status = online
| server_group =  
| cluster =  
| server_nodename =  
| server_nodename =  
}}</pre>
}}</pre>


==Example==
==Example==
*[[Db10]]
*[[db10]]


[[Category:Templates|{{PAGENAME}}]]
[[Category:Templates|{{PAGENAME}}]]
</noinclude>
</noinclude>

Latest revision as of 15:53, 17 June 2022

server
Location: sandbox
Cluster: Example services
Node name: foo.examplenet (fingerprint)
Status
Overall: Symbol support vote.png Active
Icinga?: host status services status
Hardware
Software

This template categorizes the host page into:

Parameters

location
(required) Which data center this server is located in.
name
(optional: defaults to {{PAGENAME}}
serial
(optional)
usage
(optional) ID of usage (see Category:Servers by usage for possible values)
usage-multi
(optional) Overwrites usage for embedding multiple templates directly.
status
(optional) Use active or decom (see Template:Server/status)
memory
(optional)
cpu
(optional)
hdd
(optional)
os
(optional)
kernel
(optional)
cluster
(optional) Name of organizational server group (not physical per se).
server_nodename
(optional) "Node" hostname.
racktables_id
(optional) The "object_id" of the server in Racktables
netbox
(optional) The "object_id" of the server in Netbox

<templatedata> { "params": { "name": { "label": "Name", "description": "Name of the server", "type": "string", "default": "Server" }, "location": { "label": "Location", "description": "Which data center this server is located in.", "example": "eqiad", "type": "string", "required": true, "suggested": true }, "usage": { "label": "Usage", "description": "Main purpose of the server. See \"Category:Servers by usage\" for expected values.", "type": "string", "suggested": true }, "status": { "label": "Status", "description": "Use one of \"active\", or \"decom\"", "type": "string", "default": "active" }, "cluster": { "aliases": [ "server_group" ], "label": "Cluster", "type": "string" } }, "paramOrder": [ "name", "location", "status", "usage", "cluster" ], "format": "block" } </templatedata>

Usage

{{Server
| location = 
| name = 
| netbox = 
| usage = 
| status = online
| cluster = 
| server_nodename = 
}}

Example