System
System
¶
Bases: Base
Gets system-related information from the router.
Attributes:
| Name | Type | Description |
|---|---|---|
identity |
str
|
Name of the router (format: 'HS-A (192.168.88.1) on RB912UAG-5HPnD (mipsbe)'). |
routerboard |
dict
|
If the router is a RouterBoard, returns a dictionary with board information. |
license |
dict
|
A dictionary with router license information. |
note |
str
|
Notes of about the router. |
resources |
dict
|
A dictionary with router hardware information. |
Source code in netmikro/modules/system.py
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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | |
clock_date_get()
¶
Returns the router's system date.
Returns:
| Name | Type | Description |
|---|---|---|
date |
date
|
An instance of the |
Examples:
>>> router.clock_date_get()
datetime.date(2020, 12, 31)
>>> router.clock_date_get().isoformat()
'2020-12-31'
Source code in netmikro/modules/system.py
clock_dst_active_get()
¶
Returns True if DST is enabled, if not enabled, returns False.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if DST is enabled, if not enabled, returns False. |
Examples:
Source code in netmikro/modules/system.py
clock_gmt_offset_get()
¶
Returns the router's GMT offset.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
GMT offset in the format +/-HH:MM. |
Examples:
Source code in netmikro/modules/system.py
clock_time_get()
¶
Returns the router's system time.
Returns:
| Name | Type | Description |
|---|---|---|
time |
time
|
Time with time zone, an instance of the |
Examples:
>>> router.clock_time_get()
datetime.time(5, 41, 24)
>>> router.clock_time_get().isoformat()
'15:30:00'
Source code in netmikro/modules/system.py
clock_time_zone_autodetect_get()
¶
Returns True if time-zone-autodetect is enabled, if not enabled, it returns False.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if time-zone-autodetect is enabled, if not enabled, returns False. |
Examples:
Source code in netmikro/modules/system.py
clock_time_zone_get()
¶
Returns the router's time zone.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Time zone in the format Continent/City. |
Examples:
Source code in netmikro/modules/system.py
health_temperature()
¶
Returns the current temperature at the router.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Temperature in Celsius. |
Examples:
Source code in netmikro/modules/system.py
health_voltage()
¶
Returns the current voltage at the router.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Voltage in Volts. |
Examples:
Source code in netmikro/modules/system.py
history_system_get()
¶
Returns the history of changes made to the router's system settings.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
History of changes made to the router's system settings |
Examples:
>>> router.history_system_get()
Flags: U - UNDOABLE
Columns: ACTION, BY, POLICY
ACTION BY POLICY
U ntp settings changed hick write
U changed system note settings hick write
U changed system note settings hick write
U ip service changed hick write
Source code in netmikro/modules/system.py
identity_set(new_identity)
¶
Sets the router's identity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_identity
|
str
|
New identity to be set. |
required |
Examples:
Source code in netmikro/modules/system.py
is_routerboard()
¶
Returns True if the router is a RouterBoard, if not, returns False.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the router is a RouterBoard, if not, returns False. |
Source code in netmikro/modules/system.py
note_set(note, show_at_login=False)
¶
Sets the router's note.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
note
|
str
|
New note to be set. |
required |
show_at_login
|
bool
|
Tells whether the user should see the note when logging in. |
False
|
Examples:
Source code in netmikro/modules/system.py
ntp_client_get()
¶
Returns the NTP client configuration.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
NTPClient
|
Dictionary with the NTP client configuration. |
Examples:
>>> router.ntp_client_get()
{
'enabled': True,
'freq-diff': '3.082 PPM',
'mode': 'unicast',
'servers': ['200.160.7.186', '201.49.148.135'],
'status': 'synchronized',
'synced-server': '200.160.7.186',
'synced-stratum': 1,
'system-offset': -0.915,
'vrf': 'main'
}
Source code in netmikro/modules/system.py
ntp_client_set(servers, enabled=True, mode='unicast', vrf='main')
¶
Sets the NTP client configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
servers
|
list
|
List of NTP servers. |
required |
enabled
|
bool
|
Specifies whether the NTP client should be enabled. |
True
|
mode
|
str
|
Specifies the NTP client mode. |
'unicast'
|
vrf
|
str
|
Specifies the VRF to be used by the NTP client. |
'main'
|
Examples:
Source code in netmikro/modules/system.py
ntp_server_get()
¶
Returns the NTP server configuration.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
NTPServer
|
Dictionary with the NTP server configuration. |
Examples:
>>> router.ntp_server_get()
{
'broadcast': False,
'broadcast-address': None,
'enabled': False,
'manycast': False,
'multicast': False,
'vrf': 'main'
}