If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to REGISTER before you can post. To start viewing messages, select the forum that you want to visit from the selection below.
Have a search in the forums. I know myself and others have posted some solutions for this. If you're having trouble finding something that works just ask again. :-)
Try looking for some of the following terms, process list remote command
Ok, I did a search and found only tips how to if check specific service is running.
Is there a way to get a list of all running services?
Thanks,
Micholus
Thanks for reply!
When I run it from server I get ZBX_NOTSUPPORTED.
How Can I use it in a template? Should I create Item system.run["net start"] with type "Text"?
EDIT:
I've managed to get a list of running services.
In zabbix_agentd.conf I added : UserParameter=service.running, net start
And in zabbix server an item: service.running with type text.
It works just fine
I've tried to do the same with a list of running processes:
UserParameter=pr.running, wmic process get Caption,Commandline,Processid
But when I try to run it from server :zabbix_get -s host -k pr.running
I get: "Timeout while executing operation."
I've also tried with pslist.exe from sysinternatls
UserParameter=pr.running, pslist.exe -m
but I got the same result :|
I would really appreciate any help
I wrote a script a while ago to do this which I have attached. It must be run as a remote command. When it is run it will take the output of the script given on the command line and then send that to the server into the appropriate log item.
When I last worked with this script it was definitely in development. I don't remember it's state (working/broken/bug in Zabbix), however it can be useful to point you in the right direction.
For the remote command action I have the following entry:
lisa:/etc/zabbix/scripts/ruby_proc_sender.rb -s server.ip.address.or.host.name.here -h lisa -k trap.log -c "ps -eo pcpu\,pmem\,command|sort -k1|tail -10" -D >> /tmp/debug.out
This will run the ruby script attached which sits on my host named Lisa. The script is then fed another sub script or set of commands, the results of which is fed back to the server.
You will also need to enable remote commands on your agent:
EnableRemoteCommands=1
The script is pretty well documented overall. I do recall one very annoying and hard to figure out how to fix bug from when I was working on this though. There was a limitation in the string length for calling external scripts. I don't know if this bug still exists or not.
Comment