fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
6feec60a8
master
1set -l runtime config_cache_reload\ 2 housekeeper_execute\ 3 trigger_housekeeper_execute\ 4 log_level_increase\ 5"log_level_increase=" \ 6 log_level_decrease\ 7"log_level_decrease=" \ 8 snmp_cache_reload\ 9 secrets_reload\ 10 diaginfo\ 11"diaginfo=" \ 12 prof_enable\ 13 prof_enable=\ 14 prof_disable\ 15 prof_disable=\ 16 service_cache_reload\ 17 ha_status\ 18"ha_remove_node=" \ 19 ha_set_failover_delay 20 21set -l scope rwlock mutex processing 22 23function __fish_string_in_command -a ch 24string match -rq --$ch ( commandline ) 25end 26 27function __fish_prepend -a prefix 28set -l log_target alerter\ 29"alert manager" \ 30"configuration syncer" \ 31 discoverer\ 32 escalator\ 33"history syncer" \ 34 housekeeper\ 35"http poller" \ 36"icmp pinger" \ 37"ipmi manager" \ 38"ipmi poller" \ 39"java poller" \ 40 poller\ 41"preprocessing manager" \ 42"preprocessing worker" \ 43"proxy poller" \ 44 self-monitoring\ 45"snmp trapper" \ 46"task manager" \ 47 timer\ 48 trapper\ 49"unreachable poller" \ 50"vmware collector" \ 51"history poller" \ 52"availability manager" \ 53"service manager" \ 54"odbc poller" 55 56if string match -rq'log_level_(in|de)crease' $prefix 57set var$log_target 58else if string match -rq'prof_(en|dis)able' $prefix 59set var$log_target 'ha manager' 60else if string match -rq diaginfo$prefix 61set var historycache preprocessing alerting lld valuecache locks 62end 63 64for iin $var 65echo $prefix =" $i " 66end 67end 68 69function __fish_list_nodes 70zabbix_server -R ha_status| tail -n+4| awk '{print "ha_remove_node="$3}' 71end 72 73# General 74complete -c zabbix_server -s c -l config -d"Path to the configuration file." 75complete -c zabbix_server -f -s f -l foreground -d"Run Zabbix server in foreground." 76complete -c zabbix_server -f -s h -l help -d"Display this help message." 77complete -c zabbix_server -f -s V -l version -d"Display version number." 78complete -c zabbix_server -f -s R -l runtime-control -a" $runtime " -d"Perform administrative functions." 79 80# Log levels 81complete -c zabbix_server -r -f -s R -l runtime-control -n"__fish_string_in_command log_level_increase" -a"(__fish_prepend log_level_increase)" 82complete -c zabbix_server -r -f -s R -l runtime-control -n"__fish_string_in_command log_level_decrease" -a"(__fish_prepend log_level_decrease)" 83 84# Prof enable 85complete -c zabbix_server -r -f -s R -l runtime-control -n"__fish_string_in_command prof_enable" -a"(__fish_prepend prof_enable)" 86complete -c zabbix_server -r -f -s R -l runtime-control -n"__fish_string_in_command prof_disable" -a"(__fish_prepend prof_disable)" 87 88# HA nodes 89complete -c zabbix_server -r -f -s R -l runtime-control -n"__fish_string_in_command ha_remove_node" -a"(__fish_list_nodes)" 90 91# diaginfo 92complete -c zabbix_server -r -f -s R -l runtime-control -n"__fish_string_in_command diaginfo" -a"(__fish_prepend diaginfo)"