Is there a way to clone host definitions in bb-hosts?
list John Burk
I'm using hobbit for monitoring a compute cluster of nearly 1000 identical hosts. I'm using includes in my bb-hosts to keep the file length down, but my included files are comprised of hundreds of hosts all identical except for the ipaddresses and hostnames. Surely there must be a way to template this, I just can't find it in the bb-hosts manpage... << bb-hosts >> ============================== 172.16.133.45 spork # bbd http://spork/ group Qube Supervisor 172.16.136.68 greenjeans # conn mysql RAID NOCOLUMNS:files,ports TRENDS:*,vmstat:vmstat|vmstat5,mysql:mysql|mysqlthreadsconnected|mysqlthreadrunqueue|mysqlopenfiles|mysqlopentables|mysqlopenedtables|mysqlrestrictiontablerowcount page farm Farm Hosts include clients.d/opteron include clients.d/rfl include clients.d/hp_blade ============================== Right now I'm doing this: << clients.d/hpblade >> ============================== subpage chassis01 bladeChassis 01 172.16.131.20 rn0101 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.21 rn0102 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.22 rn0103 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.23 rn0104 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.24 rn0105 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.25 rn0106 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.26 rn0107 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.27 rn0108 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.28 rn0109 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.29 rn0110 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.30 rn0111 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.31 rn0112 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.32 rn0113 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.33 rn0114 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.34 rn0115 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.35 rn0116 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports subpage chassis02 bladeChassis 02 172.16.131.60 rn0201 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.61 rn0202 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.62 rn0203 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.63 rn0204 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports and so on in mind-numbing repetition... ============================== I'd like to be able to define the tags in a template, and simply use that template. Does this mechanism exist in bb-host? That way if/when I need to change the tags for all my hosts, I only need to do it in one place, and not on every line in 3 different files. John Burk
list Josh Luthman
Get familiar with bash or tcsh =)
▸
On Tue, Jun 10, 2008 at 7:29 PM, John Burk <user-fd40c532888d@xymon.invalid> wrote:I'm using hobbit for monitoring a compute cluster of nearly 1000 identical hosts. I'm using includes in my bb-hosts to keep the file length down, but my included files are comprised of hundreds of hosts all identical except for the ipaddresses and hostnames. Surely there must be a way to template this, I just can't find it in the bb-hosts manpage... << bb-hosts >> ============================== 172.16.133.45 spork # bbd http://spork/ group Qube Supervisor 172.16.136.68 greenjeans # conn mysql RAID NOCOLUMNS:files,ports TRENDS:*,vmstat:vmstat|vmstat5,mysql:mysql|mysqlthreadsconnected|mysqlthreadrunqueue|mysqlopenfiles|mysqlopentables|mysqlopenedtables|mysqlrestrictiontablerowcount page farm Farm Hosts include clients.d/opteron include clients.d/rfl include clients.d/hp_blade ============================== Right now I'm doing this: << clients.d/hpblade >> ============================== subpage chassis01 bladeChassis 01 172.16.131.20 rn0101 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.21 rn0102 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.22 rn0103 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.23 rn0104 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.24 rn0105 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.25 rn0106 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.26 rn0107 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.27 rn0108 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.28 rn0109 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.29 rn0110 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.30 rn0111 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.31 rn0112 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.32 rn0113 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.33 rn0114 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.34 rn0115 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.35 rn0116 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports subpage chassis02 bladeChassis 02 172.16.131.60 rn0201 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.61 rn0202 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.62 rn0203 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.63 rn0204 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports and so on in mind-numbing repetition... ============================== I'd like to be able to define the tags in a template, and simply use that template. Does this mechanism exist in bb-host? That way if/when I need to change the tags for all my hosts, I only need to do it in one place, and not on every line in 3 different files. John Burk
--
Josh Luthman
Office: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX
Those who don't understand UNIX are condemned to reinvent it, poorly.
--- Henry Spencer
list John Burk
let's just assume that after wrangling *nix machines for over 20 years I'm familiar with a couple of shells. What I'm looking for is a more helpful answer; loading several files up into vi and doing a search and replace on all lines that match a pattern feels kludgy to me. 2008/6/10 Josh Luthman <user-4c45a83f15cb@xymon.invalid>:
▸
Get familiar with bash or tcsh =) On Tue, Jun 10, 2008 at 7:29 PM, John Burk <user-fd40c532888d@xymon.invalid> wrote:I'm using hobbit for monitoring a compute cluster of nearly 1000 identical hosts. I'm using includes in my bb-hosts to keep the file length down, but my included files are comprised of hundreds of hosts all identical except for the ipaddresses and hostnames. Surely there must be a way to template this, I just can't find it in the bb-hosts manpage... << bb-hosts >> ============================== 172.16.133.45 spork # bbd http://spork/ group Qube Supervisor 172.16.136.68 greenjeans # conn mysql RAID NOCOLUMNS:files,ports TRENDS:*,vmstat:vmstat|vmstat5,mysql:mysql|mysqlthreadsconnected|mysqlthreadrunqueue|mysqlopenfiles|mysqlopentables|mysqlopenedtables|mysqlrestrictiontablerowcount page farm Farm Hosts include clients.d/opteron include clients.d/rfl include clients.d/hp_blade ============================== Right now I'm doing this: << clients.d/hpblade >> ============================== subpage chassis01 bladeChassis 01 172.16.131.20 rn0101 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.21 rn0102 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.22 rn0103 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.23 rn0104 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.24 rn0105 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.25 rn0106 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.26 rn0107 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.27 rn0108 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.28 rn0109 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.29 rn0110 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.30 rn0111 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.31 rn0112 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.32 rn0113 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.33 rn0114 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.34 rn0115 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.35 rn0116 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports subpage chassis02 bladeChassis 02 172.16.131.60 rn0201 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.61 rn0202 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.62 rn0203 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.63 rn0204 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports and so on in mind-numbing repetition... ============================== I'd like to be able to define the tags in a template, and simply use that template. Does this mechanism exist in bb-host? That way if/when I need to change the tags for all my hosts, I only need to do it in one place, and not on every line in 3 different files. John Burk-- Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX Those who don't understand UNIX are condemned to reinvent it, poorly. --- Henry Spencer
list Josh Luthman
What I do in cases of this are to use for, if/then kind of things. Example, I have a log that sticks in lines like 1.2.3.4 n y 2.2.5.6 x z And I find repeating lines by IP in $1 then get a count of them using wc. I can show you the script if this didn't come out clear. Josh
▸
On 6/10/08, John Burk <user-fd40c532888d@xymon.invalid> wrote:let's just assume that after wrangling *nix machines for over 20 years I'm familiar with a couple of shells. What I'm looking for is a more helpful answer; loading several files up into vi and doing a search and replace on all lines that match a pattern feels kludgy to me. 2008/6/10 Josh Luthman <user-4c45a83f15cb@xymon.invalid>:Get familiar with bash or tcsh =) On Tue, Jun 10, 2008 at 7:29 PM, John Burk <user-fd40c532888d@xymon.invalid> wrote:I'm using hobbit for monitoring a compute cluster of nearly 1000 identical hosts. I'm using includes in my bb-hosts to keep the file length down, but my included files are comprised of hundreds of hosts all identical except for the ipaddresses and hostnames. Surely there must be a way to template this, I just can't find it in the bb-hosts manpage... << bb-hosts >> ============================== 172.16.133.45 spork # bbd http://spork/ group Qube Supervisor 172.16.136.68 greenjeans # conn mysql RAID NOCOLUMNS:files,ports TRENDS:*,vmstat:vmstat|vmstat5,mysql:mysql|mysqlthreadsconnected|mysqlthreadrunqueue|mysqlopenfiles|mysqlopentables|mysqlopenedtables|mysqlrestrictiontablerowcount page farm Farm Hosts include clients.d/opteron include clients.d/rfl include clients.d/hp_blade ============================== Right now I'm doing this: << clients.d/hpblade >> ============================== subpage chassis01 bladeChassis 01 172.16.131.20 rn0101 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.21 rn0102 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.22 rn0103 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.23 rn0104 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.24 rn0105 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.25 rn0106 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.26 rn0107 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.27 rn0108 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.28 rn0109 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.29 rn0110 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.30 rn0111 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.31 rn0112 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.32 rn0113 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.33 rn0114 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.34 rn0115 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.35 rn0116 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports subpage chassis02 bladeChassis 02 172.16.131.60 rn0201 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.61 rn0202 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.62 rn0203 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.63 rn0204 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports and so on in mind-numbing repetition... ============================== I'd like to be able to define the tags in a template, and simply use that template. Does this mechanism exist in bb-host? That way if/when I need to change the tags for all my hosts, I only need to do it in one place, and not on every line in 3 different files. John Burk-- Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX Those who don't understand UNIX are condemned to reinvent it, poorly. --- Henry Spencer
-- Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX Those who don't understand UNIX are condemned to reinvent it, poorly. --- Henry Spencer
list Hobbit User in Richmond
▸
On Tue, June 10, 2008 20:50, John Burk wrote:
let's just assume that after wrangling *nix machines for over 20 years I'm familiar with a couple of shells. What I'm looking for is a more helpful answer; loading several files up into vi and doing a search and replace on all lines that match a pattern feels kludgy to me.
Same background here, and my thoughts about that response were less charitable than yours. You probably know that whatever you're doing in vi (or vim) with search and replace could be scripted using a sed pipe and very similar syntax to your vi commands. AFAIK, you'd have to template this yourself and write such a script to transform your templates into bb-host includes. I hope someone else on the list can be more helpful than that. regards, j. Hodie natus est radici frater.
list Colin Coe
Our cluster nodes are node000 -> node999 We do the following: for I in `seq -w 0 999`; do echo "`getent hosts node$I | cut -d' ' -f1` node$I # ssh etc"; done > /tmp/output.txt CC
▸
-----Original Message----- From: Josh Luthman [mailto:user-4c45a83f15cb@xymon.invalid] Sent: Wednesday, 11 June 2008 9:15 AM To: user-ae9b8668bcde@xymon.invalid Subject: Re: [hobbit] Is there a way to clone host definitions in bb-hosts? What I do in cases of this are to use for, if/then kind of things. Example, I have a log that sticks in lines like 1.2.3.4 n y 2.2.5.6 x z And I find repeating lines by IP in $1 then get a count of them using wc. I can show you the script if this didn't come out clear. Josh On 6/10/08, John Burk <user-fd40c532888d@xymon.invalid> wrote:let's just assume that after wrangling *nix machines for over 20 years I'm familiar with a couple of shells. What I'm looking for is a more helpful answer; loading several files up into vi and doing a search and replace on all lines that match a pattern feels kludgy to me. 2008/6/10 Josh Luthman <user-4c45a83f15cb@xymon.invalid>:Get familiar with bash or tcsh =) On Tue, Jun 10, 2008 at 7:29 PM, John Burk <user-fd40c532888d@xymon.invalid> wrote:I'm using hobbit for monitoring a compute cluster of nearly 1000 identical hosts. I'm using includes in my bb-hosts to keep the file length down, but my included files are comprised of hundreds of hosts all identical except for the ipaddresses and hostnames. Surely there must be a way to template this, I just can't find it in the bb-hosts manpage... << bb-hosts >> ============================== 172.16.133.45 spork # bbd http://spork/ group Qube Supervisor 172.16.136.68 greenjeans # conn mysql RAID NOCOLUMNS:files,ports
TRENDS:*,vmstat:vmstat|vmstat5,mysql:mysql|mysqlthreadsconnect ed|mysqlthreadrunqueue|mysqlopenfiles|mysqlopentables|mysqlope nedtables|mysqlrestrictiontablerowcount
▸
page farm Farm Hosts include clients.d/opteron include clients.d/rfl include clients.d/hp_blade ============================== Right now I'm doing this: << clients.d/hpblade >> ============================== subpage chassis01 bladeChassis 01 172.16.131.20 rn0101 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.21 rn0102 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.22 rn0103 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.23 rn0104 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.24 rn0105 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.25 rn0106 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.26 rn0107 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.27 rn0108 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.28 rn0109 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.29 rn0110 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.30 rn0111 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.31 rn0112 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.32 rn0113 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.33 rn0114 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.34 rn0115 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.35 rn0116 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports subpage chassis02 bladeChassis 02 172.16.131.60 rn0201 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.61 rn0202 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.62 rn0203 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports 172.16.131.63 rn0204 # NOPROPRED:+cpu NOPROPYELLOW:+memory NOCOLUMNS:files,ports and so on in mind-numbing repetition... ============================== I'd like to be able to define the tags in a template, and simply use that template. Does this mechanism exist in bb-host? That way if/when I need to change the tags for all my hosts, I only need to do it in one place, and not on every line in 3 different files. John Burk-- Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX Those who don't understand UNIX are condemned to reinvent it, poorly. --- Henry Spencer-- Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX Those who don't understand UNIX are condemned to reinvent it, poorly. --- Henry Spencer
NOTICE: This email and any attachments are confidential. They may contain legally privileged information or copyright material. You must not read, copy, use or disclose them without authorisation. If you are not an intended recipient, please contact us at once by return email and then delete both messages and all attachments.
list Josh Luthman
Wait - could you not just sort the entire file by $1 and then wc and have it output what has occured 2 or more times?
▸
On 6/10/08, Hobbit User in Richmond <user-24d6f8323faa@xymon.invalid> wrote:On Tue, June 10, 2008 20:50, John Burk wrote:let's just assume that after wrangling *nix machines for over 20 years I'm familiar with a couple of shells. What I'm looking for is a more helpful answer; loading several files up into vi and doing a search and replace on all lines that match a pattern feels kludgy to me.Same background here, and my thoughts about that response were less charitable than yours. You probably know that whatever you're doing in vi (or vim) with search and replace could be scripted using a sed pipe and very similar syntax to your vi commands. AFAIK, you'd have to template this yourself and write such a script to transform your templates into bb-host includes. I hope someone else on the list can be more helpful than that. regards, j. Hodie natus est radici frater.
-- Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX Those who don't understand UNIX are condemned to reinvent it, poorly. --- Henry Spencer
list Tim McCloskey
As mentioned, perhaps someone with knowledge on the topic can answer. To extend the question further, since macros (variables) are able to be used within the hobbit-alerts.cfg file I wonder if variables can be assigned in bb-hosts and hobbit-clients.cfg? At one point I thought of trying to keep all of our host/client/alerts data within mysql, but it was only a thought. Regards, Tim
▸
John Burk wrote:
I'm using includes in my bb-hosts to keep the filelength down, but my included files are comprised of hundreds of hosts all identical except for the ipaddresses and hostnames. Surely there must be a way to template this, I just can't find it in the bb-hosts manpage...
...
and so on in mind-numbing repetition... ============================== I'd like to be able to define the tags in a template, and simply use that template. Does this mechanism exist in bb-host? That way if/when I need to change the tags for all my hosts, I only need to do it in one place, and not on every line in 3 different files.
list Tim McCloskey
So I was curious about the whole macro thing and decided to test it out. It has only been a few minutes but the following seems to work fine. I hope this helps in some way. bb-hosts: $foo="dns" ipaddress servername # $foo Regards, Tim
▸
Tim McCloskey wrote:As mentioned, perhaps someone with knowledge on the topic can answer. To extend the question further, since macros (variables) are able to be used within the hobbit-alerts.cfg file I wonder if variables can be assigned in bb-hosts and hobbit-clients.cfg? At one point I thought of trying to keep all of our host/client/alerts data within mysql, but it was only a thought. Regards, Tim John Burk wrote: I'm using includes in my bb-hosts to keep the filelength down, but my included files are comprised of hundreds of hosts all identical except for the ipaddresses and hostnames. Surely there must be a way to template this, I just can't find it in the bb-hosts manpage......and so on in mind-numbing repetition... ============================== I'd like to be able to define the tags in a template, and simply use that template. Does this mechanism exist in bb-host? That way if/when I need to change the tags for all my hosts, I only need to do it in one place, and not on every line in 3 different files.
list Tim McCloskey
I spoke too soon.... Seems that it only worked since I copied an existing host (with a defined 'dns' test). So I had 2 lines of the same host, both testing dns, but probably not from $foo on the second line. Changing $foo to smtp did not work. Oh well, live and learn. Sorry about the extra email folks. Tim McCloskey wrote:
bb-hosts: $foo="dns" ipaddress servername # $foo
list John Burk
Sweet. This is exactly what I was looking for. I'll experiment tomorrow and see if the var (guess I'll have to start calling it a macro) can be defined in the body of bb-hosts and still be evaluated correctly in the include files that contain the client entries. I'm guessing it will since the section of the hobbit-alerts manpage that deals with macros mentions that macros can be nested, but that the inner macro must be defined first. This leads me to believe that the config file parser reads line-by-line evaluating as it goes. I'm just going to get started in the next day or two with alerts within hobbit, hence my unfamiliarity with macros. I had quickly scanned the hobbit-alerts manpage today but had missed the significance of the section on macros, mainly because it looked at first glance to be regex evaluation; the example with "$WEBHOSTS=%(www|intranet|support|mail).foo.com" caught my eye. Does the leading '%' always signify some sort of regular expression in hobbit? johnB 2008/6/10 Tim McCloskey <user-2644b182ab49@xymon.invalid>:
▸
So I was curious about the whole macro thing and decided to test it out. It has only been a few minutes but the following seems to work fine. I hope this helps in some way. bb-hosts: $foo="dns" ipaddress servername # $foo Regards, Tim Tim McCloskey wrote:As mentioned, perhaps someone with knowledge on the topic can answer. To extend the question further, since macros (variables) are able to be used within the hobbit-alerts.cfg file I wonder if variables can be assigned in bb-hosts and hobbit-clients.cfg? At one point I thought of trying to keep all of our host/client/alerts data within mysql, but it was only a thought. Regards, Tim John Burk wrote: I'm using includes in my bb-hosts to keep the filelength down, but my included files are comprised of hundreds of hosts all identical except for the ipaddresses and hostnames. Surely there must be a way to template this, I just can't find it in the bb-hosts manpage......and so on in mind-numbing repetition... ============================== I'd like to be able to define the tags in a template, and simply use that template. Does this mechanism exist in bb-host? That way if/when I need to change the tags for all my hosts, I only need to do it in one place, and not on every line in 3 different files.
list John Burk
Oh well... would have been nice. Might be something to add as a feature request. I've been doing clusters for quite a few years now, and have seen the size of them increase from commonly less than a hundred hosts to 1000+ in the last few years. 1000+ is not out of the ordinary now, whereas even 3 years ago one I did that was 350 hosts would have wound up around #115 in the top 500 supercomputer list (or so the IBM tech who came by to see it told me). When the cluster sizes grow like this, the config files can get kind of unwieldy without some sort of template syntax. It's too bad there's also not a feature to pull the addr's from the dns or some other resolution mechanism, and an expression syntax to define a range of hosts, eg, if you had hosts node0001-node1500, you could express it in one line as: + node[0001-1500] # conn NOPROPRED:+cpu where the "+" (or some other token) would tell hobbit to do an address lookup instead of pulling it from the bb-hosts file. Barring that, the cluster mgmt s/w I use does use a similar type of syntax for host range definition, and I can always use the cmd-line tools from that to list the host info for the cluster, then pipe that through awk/sed and build the client include files on the fly, but it harks back to the days of perl one-liners. Not that that's necessarily a bad thing... johnB 2008/6/10 John Burk <user-fd40c532888d@xymon.invalid>:
▸
Sweet. This is exactly what I was looking for. I'll experiment tomorrow and see if the var (guess I'll have to start calling it a macro) can be defined in the body of bb-hosts and still be evaluated correctly in the include files that contain the client entries. I'm guessing it will since the section of the hobbit-alerts manpage that deals with macros mentions that macros can be nested, but that the inner macro must be defined first. This leads me to believe that the config file parser reads line-by-line evaluating as it goes. I'm just going to get started in the next day or two with alerts within hobbit, hence my unfamiliarity with macros. I had quickly scanned the hobbit-alerts manpage today but had missed the significance of the section on macros, mainly because it looked at first glance to be regex evaluation; the example with "$WEBHOSTS=%(www|intranet|support|mail).foo.com" caught my eye. Does the leading '%' always signify some sort of regular expression in hobbit? johnB 2008/6/10 Tim McCloskey <user-2644b182ab49@xymon.invalid>:So I was curious about the whole macro thing and decided to test it out. It has only been a few minutes but the following seems to work fine. I hope this helps in some way. bb-hosts: $foo="dns" ipaddress servername # $foo Regards, Tim Tim McCloskey wrote:As mentioned, perhaps someone with knowledge on the topic can answer. To extend the question further, since macros (variables) are able to be used within the hobbit-alerts.cfg file I wonder if variables can be assigned in bb-hosts and hobbit-clients.cfg? At one point I thought of trying to keep all of our host/client/alerts data within mysql, but it was only a thought. Regards, Tim John Burk wrote: I'm using includes in my bb-hosts to keep the filelength down, but my included files are comprised of hundreds of hosts all identical except for the ipaddresses and hostnames. Surely there must be a way to template this, I just can't find it in the bb-hosts manpage......and so on in mind-numbing repetition... ============================== I'd like to be able to define the tags in a template, and simply use that template. Does this mechanism exist in bb-host? That way if/when I need to change the tags for all my hosts, I only need to do it in one place, and not on every line in 3 different files.
list Josh Luthman
Colin gets what I'm saying! That is exactly what I was getting to. On Tue, Jun 10, 2008 at 9:26 PM, Coe, Colin C. (Unix Engineer)
▸
<user-cb2fa5e35aea@xymon.invalid> wrote:Our cluster nodes are node000 -> node999 We do the following: for I in `seq -w 0 999`; do echo "`getent hosts node$I | cut -d' ' -f1` node$I # ssh etc"; done > /tmp/output.txt CC-----Original Message----- From: Josh Luthman [mailto:user-4c45a83f15cb@xymon.invalid] Sent: Wednesday, 11 June 2008 9:15 AM To: user-ae9b8668bcde@xymon.invalid Subject: Re: [hobbit] Is there a way to clone host definitions in bb-hosts? What I do in cases of this are to use for, if/then kind of things. Example, I have a log that sticks in lines like 1.2.3.4 n y 2.2.5.6 x z And I find repeating lines by IP in $1 then get a count of them using wc. I can show you the script if this didn't come out clear. Josh On 6/10/08, John Burk <user-fd40c532888d@xymon.invalid> wrote:let's just assume that after wrangling *nix machines for over 20 years I'm familiar with a couple of shells. What I'm looking for is a more helpful answer; loading several files up into vi and doing a search and replace on all lines that match a pattern feels kludgy to me. 2008/6/10 Josh Luthman <user-4c45a83f15cb@xymon.invalid>:Get familiar with bash or tcsh =) On Tue, Jun 10, 2008 at 7:29 PM, John Burk<user-fd40c532888d@xymon.invalid> wrote:I'm using hobbit for monitoring a compute cluster of nearly 1000 identical hosts. I'm using includes in my bb-hosts to keep the file length down, but my included files are comprised of hundreds of hosts all identical except for the ipaddresses and hostnames. Surely there must be a way to template this, I just can't find it in the bb-hosts manpage... << bb-hosts >> ============================== 172.16.133.45 spork # bbd http://spork/ group Qube Supervisor 172.16.136.68 greenjeans # conn mysql RAID NOCOLUMNS:files,portsTRENDS:*,vmstat:vmstat|vmstat5,mysql:mysql|mysqlthreadsconnect ed|mysqlthreadrunqueue|mysqlopenfiles|mysqlopentables|mysqlope nedtables|mysqlrestrictiontablerowcountpage farm Farm Hosts include clients.d/opteron include clients.d/rfl include clients.d/hp_blade ============================== Right now I'm doing this: << clients.d/hpblade >> ============================== subpage chassis01 bladeChassis 01 172.16.131.20 rn0101 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.21 rn0102 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.22 rn0103 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.23 rn0104 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.24 rn0105 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.25 rn0106 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.26 rn0107 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.27 rn0108 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.28 rn0109 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.29 rn0110 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.30 rn0111 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.31 rn0112 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.32 rn0113 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.33 rn0114 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.34 rn0115 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.35 rn0116 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports subpage chassis02 bladeChassis 02 172.16.131.60 rn0201 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.61 rn0202 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.62 rn0203 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports 172.16.131.63 rn0204 # NOPROPRED:+cpuNOPROPYELLOW:+memoryNOCOLUMNS:files,ports and so on in mind-numbing repetition... ============================== I'd like to be able to define the tags in a template, and simply use that template. Does this mechanism exist in bb-host? That way if/when I need to change the tags for all my hosts, I only need to do it in one place, and not on every line in 3 different files. John Burk-- Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX Those who don't understand UNIX are condemned to reinvent it, poorly. --- Henry Spencer-- Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX Those who don't understand UNIX are condemned to reinvent it, poorly. --- Henry SpencerNOTICE: This email and any attachments are confidential. They may contain legally privileged information or copyright material. You must not read, copy, use or disclose them without authorisation. If you are not an intended recipient, please contact us at once by return email and then delete both messages and all attachments.
-- Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX Those who don't understand UNIX are condemned to reinvent it, poorly. --- Henry Spencer
list Buchan Milne
▸
On Wednesday 11 June 2008 01:29:21 John Burk wrote:
I'm using hobbit for monitoring a compute cluster of nearly 1000 identical hosts. I'm using includes in my bb-hosts to keep the file length down, but my included files are comprised of hundreds of hosts all identical except for the ipaddresses and hostnames. Surely there must be a way to template this, I just can't find it in the bb-hosts manpage...
[...]
I'd like to be able to define the tags in a template, and simply use that template. Does this mechanism exist in bb-host?
No. This is the biggest weakness in Hobbit, but it is also one of the BigBrother-compatibility features.
▸
That way if/when I need to change the tags for all my hosts, I only need to do it in one place, and not on every line in 3 different files.
But, do you want it only for bb-hosts (IOW, which tests to run and which tests to not propagate), or also for thresholds, log/file/dir checks, alerts etc? Henrik has mentioned that the configuration issues need to be looked at, but it's a tradeoff between simplicity+repetitive, and excessively complex. Regards, Buchan
list Tim McCloskey
Not sure if this will help but take a look at the .default. section in the bb-hosts man page. Seems that all of the odd bits could be defined there, but you would still have large lists of 'ip hostname #'.
list Heinelt Maik
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I use the Hobbit Server 4.2. Cause we have some staff here, who just only have to monitor our server status on Hobbit, I would like to disable the Menu of the Hobbit Status. I mean the menu, where it is written the "Views", "Reports", "Administration" and "Help" For the User Login, I have installed a .htaccess file. Is it possible to disable the Menu by soem user depend rules? Regards Maik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIUKxQr4r+EhimPOURAvdgAKDJPivi8Tv2bH82hMMqIYNCZKEOTQCgxEnn 8ONpXEGZnZoHR8D81eB+7F0= =lYMq -----END PGP SIGNATURE-----
list Tim McCloskey
Disable access to certain pages via .htacess and the modifiy the menu_items.js file.
~: cat menu_items.js
var MENU_ITEMS = [
['Views', null, null,
['Main view', '/bb.html'],
['All non-green view', '/bb2.html'],
['Critical systems', '/cgi-bin/hobbit-nkview.sh'],
],
];
May not be exactly what you are looking for, works for me.
Regards,
-t
Heinelt Maik wroteEdit menu:▸
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I use the Hobbit Server 4.2. Cause we have some staff here, who just only have to monitor our server status on Hobbit, I would like to disable the Menu of the Hobbit Status. I mean the menu, where it is written the "Views", "Reports", "Administration" and "Help" For the User Login, I have installed a .htaccess file. Is it possible to disable the Menu by soem user depend rules? Regards Maik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIUKxQr4r+EhimPOURAvdgAKDJPivi8Tv2bH82hMMqIYNCZKEOTQCgxEnn 8ONpXEGZnZoHR8D81eB+7F0= =lYMq -----END PGP SIGNATURE-----