danp

Members
  • Posts

    5
  • Joined

  • Last visited

Reputation

0 Neutral

About danp

  • Rank
    Member
    Member
  1. I know all the addresses they would be 8881-4 with the master aggregated page as 8880. I can see how we would be able to use the json slurper to pull the individual pages but that just seems like a waste of processes when we can just parse the aggregate page with some sort of web CVS slurper.
  2. Yes, each process will require it's own stats page. What we found is that when we ran multiple processes that master haproxy stats page would pull randomly from one of the running processes. Thus our stats would look like 32 current_sessions then a second later would read 15 current_sessions, the the graph was skewed. When we really needed 32+15 for total sessions. We used lau to aggregate the stats as shown here: https://discourse.haproxy.org/t/lua-solution-for-stats-aggregation-and-centralization/27 Thus it creates a master aggregate page... ours on port 8880 which dumps the csv. I ended up just doing a simple python script to pull that stats back as a keyvalue pair and extending snmp to pull them: (it was the easy solution) import requests import io import csv r = requests.get('http://127.0.0.1:8880/') f = io.StringIO(r.text) reader = csv.reader(f, delimiter=',') for row in reader: if row[0] == 'BILLY_back': print(f"{row[1]}_SessCur={row[4]}\n{row[1]}_Status={row[22]}") thus returns a clean K-V pair, which can easily be used as an snmp extension and metrics pulled into a very simple datasource BACKEND_SessCur=60 BACKEND_Status=4 FOX1_SessCur=15 FOX1_Status=4 FOX0_SessCur=15 FOX0_Status=4 FOX3_SessCur=15 FOX3_Status=4 FOX2_SessCur=15 FOX2_Status=4
  3. I may just do this with python and snmp, seems much more of a simple approach, yet requires code on servers
  4. so since i run multiple ha processes, each have their own stats page. With the JSON format I was getting weird values as stats would pull from different proceses thus my graph would be bouncing around. I finally figured out that there is a lau script that can pull stats from all the processes and aggregate them to CSV. So how my main HAprocess page shows this output And i'm wanting to parse it for the metrics i want <from my lau stats page> http:///myserver:8888 pxname,svname,qcur,qmax,scur,smax,slim,stot,bin,bout,dreq,dresp,ereq,econ,eresp,wretr,wredis,status,weight,act,bck,chkfail,chkdown,lastchg,downtime,qlimit,pid,iid,sid,throttle,lbtot,tracked,type,rate,rate_lim,rate_max,check_status,check_code,check_duration,hrsp_1xx,hrsp_2xx,hrsp_3xx,hrsp_4xx,hrsp_5xx,hrsp_other,hanafail,req_rate,req_rate_max,req_tot,cli_abrt,srv_abrt,comp_in,comp_out,comp_byp,comp_rsp,lastsess,last_chk,last_agt,qtime,ctime,rtime,ttime,agg, stats-aggregate,FRONTEND,,,0,4,800000,7,4505,44273,0,0,0,,,,,OPEN/OPEN/OPEN/OPEN,,,,,,,,,4/2/2/2,8/8/8/8,,,,,0,0,0,4,,,,0,13,0,0,0,0,,0,8,13,,,0,0,0,0,,,,,,,,statistics-cpu-4/statistics-cpu-1/statistics-cpu-3/statistics-cpu-2, BILLY_front,FRONTEND,,,5,21,800000,379,821472,7749620993,0,0,0,,,,,OPEN/OPEN/OPEN/OPEN,,,,,,,,,4/2/2/2,2/2/2/2,,,,,0,0,0,21,,,,0,0,0,0,0,0,,0,0,0,,,0,0,0,0,,,,,,,,statistics-cpu-4/statistics-cpu-1/statistics-cpu-3/statistics-cpu-2, stats-2,FRONTEND,,,1,6,600000,1350,80940,4664196,0,0,0,,,,,OPEN/OPEN/OPEN,,,,,,,,,2/2/2,5/5/5,,,,,0,3,0,9,,,,0,1349,0,0,0,0,,3,9,1350,,,0,0,0,0,,,,,,,,statistics-cpu-1/statistics-cpu-3/statistics-cpu-2, stats-4,FRONTEND,,,1,2,200000,1103,66120,3879247,0,0,0,,,,,OPEN,,,,,,,,,4,7,,,,,0,1,0,4,,,,0,1102,0,0,0,0,,1,4,1103,,,0,0,0,0,,,,,,,,statistics-cpu-4, stats-aggregate,BACKEND,0,0,0,0,80000,0,4505,44273,0,0,,0,0,0,0,UP/UP/UP/UP,0,0,0,,0,3417.0,0,,4/2/2/2,8/8/8/8,,,0,,1,0,,0,,,,0,0,0,0,0,0,,,,,0,0,0,0,0,0,725.0,,,0.0,0.0,0.0,4.25,statistics-cpu-4/statistics-cpu-1/statistics-cpu-3/statistics-cpu-2, BILLY_back,BACKEND,0,0,5,21,80000,379,821472,7749620993,0,0,,146,0,48,0,UP/UP/UP/UP,16,16,0,,4,1706.75,48.25,,4/2/2/2,3/3/3/3,,,249,,1,0,,21,,,,0,0,0,0,0,0,,,,,4,0,0,0,0,0,1321.25,,,0.0,0.0,0.0,131623.25,statistics-cpu-4/statistics-cpu-1/statistics-cpu-3/statistics-cpu-2, BILLY_back,FOX1,0,0,1,6,0,53,198554,2433438274,,0,,0,0,0,0,UP/UP/UP/UP,4,4,0,12,4,1700.0,56.0,0,4/2/2/2,3/3/3/3,2/2/2/2,0,53,0,2,0,,4,L4OK/L4OK/L4OK/L4OK,,0/0/0/0,0,0,0,0,0,0,,,,,0,0,,,,,2569.5,,,0.0,0.0,0.0,1252990.75,statistics-cpu-4/statistics-cpu-1/statistics-cpu-3/statistics-cpu-2, BILLY_back,FOX0,0,0,2,6,0,39,97291,355396905,,0,,6,0,18,0,UP/UP/UP/UP,4,4,0,12,4,1706.75,48.5,0,4/2/2/2,3/3/3/3,1/1/1/1,0,21,0,2,0,,5,L4OK/L4OK/L4OK/L4OK,,0/0/0/0,0,0,0,0,0,0,,,,,0,0,,,,,1740.5,,,0.0,0.0,0.0,461095.0,statistics-cpu-4/statistics-cpu-1/statistics-cpu-3/statistics-cpu-2, BILLY_back,FOX3,0,0,1,6,0,123,196964,2033573869,,0,,7,0,21,0,UP/UP/UP/UP,4,4,0,12,4,1691.0,64.0,0,4/2/2/2,3/3/3/3,4/4/4/4,0,102,0,2,0,,4,L4OK/L4OK/L4OK/L4OK,,0/0/0/0,0,0,0,0,0,0,,,,,1,0,,,,,1319.0,,,0.0,0.0,0.0,4631.0,statistics-cpu-4/statistics-cpu-1/statistics-cpu-3/statistics-cpu-2, BILLY_back,FOX2,0,0,1,6,0,82,328663,2927211945,,0,,3,0,9,0,UP/UP/UP/UP,4,4,0,12,4,1695.75,60.0,0,4/2/2/2,3/3/3/3,3/3/3/3,0,73,0,2,0,,4,L4OK/L4OK/L4OK/L4OK,,0/0/0/0,0,0,0,0,0,0,,,,,3,0,,,,,1327.75,,,0.0,0.0,0.0,76763.25,statistics-cpu-4/statistics-cpu-1/statistics-cpu-3/statistics-cpu-2, stats-2,BACKEND,0,0,0,0,60000,0,80940,4664196,0,0,,0,0,0,0,UP/UP/UP,0,0,0,,0,3417.0,0,,2/2/2,5/5/5,,,0,,1,0,,0,,,,0,0,0,0,0,0,,,,,0,0,0,0,0,0,0.0,,,0.0,0.0,1.0,1.0,statistics-cpu-1/statistics-cpu-3/statistics-cpu-2, stats-4,BACKEND,0,0,0,0,20000,0,66120,3879247,0,0,,0,0,0,0,UP,0,0,0,,0,3417.0,0,,4,7,,,0,,1,0,,0,,,,0,0,0,0,0,0,,,,,0,0,0,0,0,0,0.0,,,0.0,0.0,0.0,1.0,statistics-cpu-4, ie.... i want to pull "BILLY_back, FOX1 scur value"
  5. Stuart do yo happen to have a CSV version of this Datasource?