Hi,
I'm trying to create an item on the linux os template that get value in PRETTY_NAME="" in /etc/os-release. I have trying with vfs.file.regexp[] without any luck so maybe someone can point out what I'm doing wrong or have another solution to get the value without add UserParameter on each host.
Commands to use to get the string:
# sed -nE 's/^PRETTY_NAME="([^"]+)".*/\1/p' /etc/os-release
Debian GNU/Linux 8 (jessie)
# grep -oP '^PRETTY_NAME="\K[^"]+' /etc/os-release
Debian GNU/Linux 8 (jessie)
# source /etc/os-release && echo "$PRETTY_NAME"
Debian GNU/Linux 8 (jessie)
I've focus on the first command becaue the second one is perl regexp and I don't think that's supported in vfs.file.regexp[]
This is my item keys that zabbix_agentd -t return with [s|]
vfs.file.regexp["/etc/os-release","^PRETTY_NAME=\"\K[^\"]+",,,,]
vfs.file.regexp["/etc/os-release","s/^PRETTY_NAME=\"([^\"]+)\".*/\1/p",,,,]
I'm stuck and don't know how to move on so any ideas are welcome.
I'm trying to create an item on the linux os template that get value in PRETTY_NAME="" in /etc/os-release. I have trying with vfs.file.regexp[] without any luck so maybe someone can point out what I'm doing wrong or have another solution to get the value without add UserParameter on each host.
Commands to use to get the string:
# sed -nE 's/^PRETTY_NAME="([^"]+)".*/\1/p' /etc/os-release
Debian GNU/Linux 8 (jessie)
# grep -oP '^PRETTY_NAME="\K[^"]+' /etc/os-release
Debian GNU/Linux 8 (jessie)
# source /etc/os-release && echo "$PRETTY_NAME"
Debian GNU/Linux 8 (jessie)
I've focus on the first command becaue the second one is perl regexp and I don't think that's supported in vfs.file.regexp[]
This is my item keys that zabbix_agentd -t return with [s|]
vfs.file.regexp["/etc/os-release","^PRETTY_NAME=\"\K[^\"]+",,,,]
vfs.file.regexp["/etc/os-release","s/^PRETTY_NAME=\"([^\"]+)\".*/\1/p",,,,]
I'm stuck and don't know how to move on so any ideas are welcome.
[0-9]+),,,,\1] → getting the ID of user zabbix
Comment