Hi all,
I plan to write a script on our linux computers to gather several infos for zabbix. One single script does for example "ps aux | grep error", and if there is the word "error" in the process list, it writes the value 1 to /tmp/checkresults. Or even the number of lines with errors. If no errors it writes 0. Another command in the script could be "who | wc -l" and add this number to /tmp/checkresults. Like that I want to do several checks, and write the result as a number to the file checkresults, one number per line.
Then I want to define some UserParameters in agentd.conf on the linux computers where I run the checkresults script in crontab. For example:
UserParameter=pserrors,cat /tmp/checkresults | head -n 1
UserParameter=usersonline,cat /tmp/checkresults | head -n 2 | tail -n 1
... and so on till the end of the file
You see my point. The question is, if this "check system" makes sense. Do you think it's a good idea to build something like that? Or do you see some disadvantages?
I plan to write a script on our linux computers to gather several infos for zabbix. One single script does for example "ps aux | grep error", and if there is the word "error" in the process list, it writes the value 1 to /tmp/checkresults. Or even the number of lines with errors. If no errors it writes 0. Another command in the script could be "who | wc -l" and add this number to /tmp/checkresults. Like that I want to do several checks, and write the result as a number to the file checkresults, one number per line.
Then I want to define some UserParameters in agentd.conf on the linux computers where I run the checkresults script in crontab. For example:
UserParameter=pserrors,cat /tmp/checkresults | head -n 1
UserParameter=usersonline,cat /tmp/checkresults | head -n 2 | tail -n 1
... and so on till the end of the file
You see my point. The question is, if this "check system" makes sense. Do you think it's a good idea to build something like that? Or do you see some disadvantages?
Comment