-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chronograf/Kapacitor tick exec script - argument passing #6006
Comments
update: var name = 'Server CPU usage above 80%' in opparser script log i can see this output: starting handler in opparser.py but how to populate this name and message arguments with real vaules like: which i see in opcmsg.log i defined in .log('/tmp/opcmsg.log') {"id":"Server CPU usage above 80%-host=server01.local","message":"OK Server CPU usage above 80%-host=server01.local cpu","details":"","time":"2022-10-26T14:32:00Z","duration":90000000000,"level":"OK","data":{"series":[{"name":"cpu","tags":{"cpu":"cpu1","environment":"production","host":"server01.local","service":"mediation","vmtype":"vmware"},"columns":["time","usage_guest","usage_guest_nice","usage_iowait","usage_irq","usage_nice","usage_softirq","usage_steal","usage_system","usage_user","value"],"values":[["2022-10-26T14:32:00Z",0,0,1.7311608961421165,0,0,1.5274949083726768,0,11.20162932815274,48.77800407393906,36.76171079359716]]}]},"previousLevel":"CRITICAL","recoverable":true} thanks |
Hi
Chronograf Version: 1.9.1
Kapacitor OSS 1.6.4
We created tick script which should send message to Microfocus opcmsg tool which with argments sends alerts.
For this we created python script which should take argments from tick script:
in logs i see all data needed:
{"id":"Server CPU usage above 80%-host=server1.local","message":"host=server1.local CRITICAL Server CPU usage above 80%-host=server1.local cpu CRITICAL"
how can i pass arguments to this opcmsg python script
python', '/opt/opcmsg_alerting/opparser.py', arg1, arg2, arg3, arg4
where
arg1 = var measurement = 'cpu'
arg2 = var idVar = name + '-{{.Group}}'
arg3 = var levelTag = 'level'
arg4 = var message = '{{.Group}} {{.Level}} {{.ID}} {{.Name}} {{.Level}}'
and than opcmsg argemnts will be populated
i am not a programmer and i really dont know Go so please help
Thanks
tomislav
The text was updated successfully, but these errors were encountered: