hey all, I'm trying to figure out how to use apache's mod_status module to figure out which of the web servers in a farm of six are processing more requests than others. I'm writing a script to grep out requests per second from the status module like this: [root at uszmpwslp014lc ~]# GET http://$(hostname -i)/server-status | grep -i requests/sec <dt>4.08 requests/sec - 80.9 kB/second - 19.8 kB/request</dt> That works ok. And next I'm grepping it back down and awking it to just the part I'm interested in: [root at uszmpwslp014lc ~]# GET http://$(hostname -i)/server-status | grep -i -e request -e requests/sec | grep -i -v -e currently -e code -e ss | awk '{print $1}' <dt>4.08 But now I need to get rid of just the <dt> in front of the 4.08? I think I may be able to use the 'cut' command to do this, but I'm unsure how. Any thoughts? Thanks Tim -- GPG me!! gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
op 03-06-14 15:18, schreef Tim Dunphy:> [root at uszmpwslp014lc ~]# GET http://$(hostname -i)/server-status | grep > -i requests/sec > <dt>4.08 requests/sec - 80.9 kB/second - 19.8 kB/request</dt> > > > That works ok. And next I'm grepping it back down and awking it to just the > part I'm interested in: > > [root at uszmpwslp014lc ~]# GET http://$(hostname -i)/server-status | grep -i > -e request -e requests/sec | grep -i -v -e currently -e code -e ss | awk > '{print $1}' > <dt>4.08 > > But now I need to get rid of just the <dt> in front of the 4.08?cut --delimiter=">" --field=2 you could even get rid of the awk and pipe your grep to cut --delimiter=">" --field=2 | cut --delimiter=" " --field=1 But there are many different ways to solve this. greetings Patrick
Apparently Analagous Threads
- Apache server-status file not found
- Howto Draw Bimodal Gamma Curve with User Supplied Parameters
- rolling regression between adjacent columns
- [Bug 1482] New: adjacent /31 IPs in ipset
- [Bug 1417] New: mapping to adjacent ranges is causing error in kernel 5.6, kernel 5.5 works fine