Facts & system¶
System-level getters: identity, hardware health, users, and management services.
All example outputs on this page are real driver output, recorded against SR Linux nodes in a containerlab topology.
get_facts¶
Identity and inventory of the node: model, serial number, OS version, uptime in seconds, and the list of physical interfaces.
Example output
get_environment¶
Hardware health: fan and power-supply status, temperature sensors, memory and CPU usage. Values the platform doesn't report (e.g. PSU capacity on virtual nodes) follow the NAPALM convention of -1.
Example output
{
"fans": {"1": {"status": false}, "2": {"status": false}, ...},
"power": {
"1": {"status": false, "capacity": -1.0, "output": -1.0},
"2": {"status": false, "capacity": -1.0, "output": -1.0}
},
"temperature": {
"A": {"temperature": 50.0, "is_alert": false, "is_critical": false}
},
"memory": {"available_ram": 49270095872, "used_ram": 20123807744},
"cpu": {"all": {"%usage": 9.0}}
}
get_users¶
Locally configured users with their hashed passwords and SSH public keys. The admin role maps to privilege level 15, all other users to 0. SSH keys live under the standard NAPALM key sshkeys.
Example output
{
"admin": {
"level": 15,
"password": "$y$j9T$pNVjOgcNNGIWjBcdDfK/7.$Ir4uYxszxtqzVj5...",
"sshkeys": ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKUhBr4Bmuy..."]
},
"linuxadmin": {
"level": 0,
"password": "$y$j9T$0dhyedqIhXCKxo03TPudQ0$a8o6k88JXKdBKHp7...",
"sshkeys": ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKUhBr4Bmuy..."]
},
"testuser": {
"level": 0,
"password": "$y$j9T$4416195d85c38e2c$0MJ2QlwoB0JfrzJsrz5/SAT...",
"sshkeys": []
}
}
get_snmp_information¶
SNMP contact and location from the system configuration. SR Linux's SNMP framework has no classic chassis-ID or v2c community configuration, so chassis_id is empty and community is an empty dict.
get_ntp_servers¶
The configured NTP servers, as a dict keyed by server address (the values are empty dicts, per the NAPALM model).
get_ntp_stats¶
Synchronization state per configured NTP server. SR Linux exposes whether the clock is synchronized and to which server; protocol internals like stratum, poll interval, and jitter are not available via the management API and are reported as -1 / empty.
Example output
is_alive¶
Checks that the JSON-RPC endpoint still answers (an HTTP HEAD request). Because JSON-RPC is stateless there is no session that could "die" — this genuinely re-tests reachability on every call.