Dear Mr.Storner, my name's Giorgio Volpini, I'm a Computer Science student of the university of Pisa.
I need some help about your program : Hobbit. Few months ago I used Hobbit during my stage and now I'm writing a thesis about it. I'd like to complete my report with a dimostration of Bash-script to use in the program; my problem is that i don't know Bash-scripting and I have not enought time to learn it. If I don't give you too much trouble, I needa script to control the time of presence rivelators connected in Lan with Hobbit server.
I also have a general idea about the script: - ping the rivelator - compare the time of the answer packet with Hobbit system time - decide if it's all ready or not - warn the administrator with e-mail, sms or only with Hobbit web interface I need only a dimostrative script to add an my report, so is not important that it works perfectly, but only that bash-script has right syntax.
Your help is very important for me and I think it is an work for you.
Thank you very much for your attention.
Your faithfully.
Giorgio Volpini.
Dear Mr Volpini,
What on earth does "control the time of presence rivelators" mean? I have no clue. Is there a protocol to be used for this? How do you get the time from those? How do you want to control the time? Monitor? Adjust?
Bash and Bourne shell scripting is simple - as long as you only do simple things with it.
From: Giorgio Volpini [mailto:vorpini at gmail.com] Sent: Thursday, November 30, 2006 11:46 AM To: henrik at hswn.dk; hobbit at hswn.dk Subject: [hobbit] Hobbit help
Dear Mr.Storner, my name's Giorgio Volpini, I'm a Computer Science student of the university of Pisa.
I need some help about your program : Hobbit. Few months ago I used Hobbit during my stage and now I'm writing a thesis about it. I'd like to complete my report with a dimostration of Bash-script to use in the program; my problem is that i don't know Bash-scripting and I have not enought time to learn it. If I don't give you too much trouble, I needa script to control the time of presence rivelators connected in Lan with Hobbit server.
I also have a general idea about the script: - ping the rivelator - compare the time of the answer packet with Hobbit system time - decide if it's all ready or not - warn the administrator with e-mail, sms or only with Hobbit web interface I need only a dimostrative script to add an my report, so is not important that it works perfectly, but only that bash-script has right syntax.
Your help is very important for me and I think it is an work for you.
Thank you very much for your attention.
Your faithfully.
Giorgio Volpini.
To be fair why is the uni giving you a unix based thesis if you don't have bourne/bash experience?
From: Strandell, Ralf [mailto:Ralf.Strandell at silja.com] Sent: 30 November 2006 11:01 To: hobbit at hswn.dk Subject: RE: [hobbit] Hobbit help
Dear Mr Volpini,
What on earth does "control the time of presence rivelators" mean? I have no clue.
Is there a protocol to be used for this? How do you get the time from those?
How do you want to control the time? Monitor? Adjust?
Bash and Bourne shell scripting is simple - as long as you only do simple things with it.
From: Giorgio Volpini [mailto:vorpini at gmail.com] Sent: Thursday, November 30, 2006 11:46 AM To: henrik at hswn.dk; hobbit at hswn.dk Subject: [hobbit] Hobbit help
Dear Mr.Storner,
my name's Giorgio Volpini, I'm a Computer Science student of the university of Pisa.
I need some help about your program : Hobbit. Few months ago I used Hobbit during my stage and now I'm writing a thesis about it. I'd like to complete my report with a dimostration of Bash-script to use in the program; my problem is that i don't know Bash-scripting and I have not enought time to learn it. If I don't give you too much trouble, I needa script to control the time of presence rivelators connected in Lan with Hobbit server.
I also have a general idea about the script:
- ping the rivelator
- compare the time of the answer packet with Hobbit system time
- decide if it's all ready or not
- warn the administrator with e-mail, sms or only with Hobbit web
interface
I need only a dimostrative script to add an my report, so is not important that it works perfectly, but only that bash-script has right syntax.
Your help is very important for me and I think it is an work for you.
Thank you very much for your attention.
Your faithfully.
Giorgio Volpini.
Are you trying to do something with
TIMESTAMP=/bin/ping -c1 -T tsonly host.domain.com | /usr/bin/awk ' $1 == "TS:" { print $2 } '
The key here is that you can use an awk script to extract the number (field no 2 on the line begining with TS:) This extracts the big integer from the timestamp answer, but you need to know what to do with it. You can learn awk scripts and regular expressions in O´Reilly's "sed & awk pocket reference".
Another solution is to have a nice Bourne shell function like this:
tsprint() { while read line do set bogus $line # $line could be empty. Plain "set" would dump the environment variables. Hence a "bogus" and shift. shift if [ "$1" == "TS:" ] then echo "$2" break else continue # loop fi done }
TIMESTAMP=/bin/ping -c1 -T tsonly host.domain.com | tsprint
Then you can compare the size of the timestamp using ' if [ $VARIABLE -lt $THRESHOLD ]; then ... Numeric comparisons: -lt, -le, -eq, -ge, -gt String comparisons: ==, !=
Recommended reading:
- A good book about bourne shell scripts and Unix command line in general is "Sams teach yourself shell programming in 24 hours".
- Bourne shell is a bit archaic, and Bash provides many nice improvements such as calculations and arrays. "man bash" is enough, after you master the Bourne shell.
You should now be able to complete yout monitoring plugin. As your thesis is about Hobbit, you should certainly know how to implement basic extensions. Take a look at the plugins.
From: Giorgio Volpini [mailto:vorpini at gmail.com] Sent: Thursday, November 30, 2006 11:46 AM To: henrik at hswn.dk; hobbit at hswn.dk Subject: [hobbit] Hobbit help
Dear Mr.Storner, my name's Giorgio Volpini, I'm a Computer Science student of the university of Pisa.
I need some help about your program : Hobbit. Few months ago I used Hobbit during my stage and now I'm writing a thesis about it. I'd like to complete my report with a dimostration of Bash-script to use in the program; my problem is that i don't know Bash-scripting and I have not enought time to learn it. If I don't give you too much trouble, I needa script to control the time of presence rivelators connected in Lan with Hobbit server.
I also have a general idea about the script: - ping the rivelator - compare the time of the answer packet with Hobbit system time - decide if it's all ready or not - warn the administrator with e-mail, sms or only with Hobbit web interface I need only a dimostrative script to add an my report, so is not important that it works perfectly, but only that bash-script has right syntax.
Your help is very important for me and I think it is an work for you.
Thank you very much for your attention.
Your faithfully.
Giorgio Volpini.
participants (3)
-
JasonAS_Jones@mentor.com
-
Ralf.Strandell@silja.com
-
vorpini@gmail.com