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
imported>Krinkle No edit summary |
imported>Krinkle No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 7: | Line 7: | ||
{{!}}- | {{!}}- | ||
}} | }} | ||
{{#if: {{{server_group|<noinclude>demo</noinclude>}}}| | {{#if: {{{cluster|{{{server_group|<noinclude>demo</noinclude>}}}}}}| | ||
{{!}} bgcolor=#efefef {{!}} | {{!}} 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 33: | Line 38: | ||
| {{#ifeq: {{lc:{{{status|}}}}} | 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 73: | Line 78: | ||
{{!}} bgcolor=#efefef {{!}} Kernel: | {{!}} bgcolor=#efefef {{!}} Kernel: | ||
{{!}} bgcolor=#f8f8ff {{!}} {{{kernel}}} | {{!}} bgcolor=#f8f8ff {{!}} {{{kernel}}} | ||
{{!}}- | {{!}}- | ||
}} | }} | ||
|}<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}}}}} | -->[[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 91: | Line 91: | ||
This template categorizes the host page into: | This template categorizes the host page into: | ||
* [[:Category:Servers]] | * [[:Category:Servers]] | ||
* a subcategory of [[:Category: | * 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>) | ||
==Parameters== | ==Parameters== | ||
;location: (required) Which [[:Category: | ;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> | ;status: (optional) Use <code>active</code> or <code>decom</code> (see [[Template:Server/status]]) | ||
;memory: (optional) | ;memory: (optional) | ||
;cpu: (optional) | ;cpu: (optional) | ||
Line 107: | Line 107: | ||
;os: (optional) | ;os: (optional) | ||
;kernel: (optional) | ;kernel: (optional) | ||
; | ;cluster: (optional) Name of organizational server group (not physical per se). | ||
;server_nodename: (optional) "Node" hostname. | ;server_nodename: (optional) "Node" hostname. | ||
;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 123: | Line 123: | ||
"location": { | "location": { | ||
"label": "Location", | "label": "Location", | ||
"description": "Which | "description": "Which data center this server is located in.", | ||
"example": "eqiad", | "example": "eqiad", | ||
"type": "string", | "type": "string", | ||
Line 137: | Line 137: | ||
"status": { | "status": { | ||
"label": "Status", | "label": "Status", | ||
"description": "Use one of \" | "description": "Use one of \"active\", or \"decom\"", | ||
"type": "string", | "type": "string", | ||
"default": " | "default": "active" | ||
}, | |||
"cluster": { | |||
"aliases": [ | |||
"server_group" | |||
], | |||
"label": "Cluster", | |||
"type": "string" | |||
} | } | ||
}, | }, | ||
Line 146: | Line 153: | ||
"location", | "location", | ||
"status", | "status", | ||
"usage" | "usage", | ||
"cluster" | |||
], | ], | ||
"format": "block" | "format": "block" | ||
Line 156: | Line 164: | ||
| location = | | location = | ||
| name = | | name = | ||
| | | netbox = | ||
| usage = | | usage = | ||
| status = online | | status = online | ||
| | | cluster = | ||
| server_nodename = | | server_nodename = | ||
}}</pre> | }}</pre> | ||
==Example== | ==Example== | ||
*[[ | *[[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: | ![]() |
Icinga?: | host status services status |
Hardware | |
Software |
This template categorizes the host page into:
- Category:Servers
- a subcategory of Category:Data centers (based on the {{{location}}} parameter)
- a subcategory of Category:Servers by usage (based on the {{{usage}}})
- a subcategory of Category:Servers by status (based on the {{{status}}})
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
ordecom
(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 = }}