Hi Team,
There are over 20 pop/imap server configured in jira and we have to test the connection for each pop/imap server configured everyday manually as part of daily check.
Is there a way to automate this task such that jira admins will receive mail if there is any connection failure?
Thanks,
Rakshith
Hello, @Rakshith and welcome to the Community!
Have you considered using something like Zabbix or a custom script to regularly check the email servers' availability?
Hello Greg,
I thought of using below curl command to get the connection status and then use findstr to search for the string "The connection was successful."
curl -u test:test -d "@data.txt" -H "Content-Type: application/x-www-form-urlencoded" -X POST 'https://sswauat.catlin.com/secure/admin/VerifyPopServerConnection!update.jspa' > result.html
Usually checking connection would take 4-5secs to get the connection status but the above command finishes execution in 2 sec.So the html output says connection status as "Testing the connection ..."
I need to add a delay before curl redirects output to result.html so that connection testing is complete and html gets connection status as either "The connection was successful." or "Unfortunately no connection was possible."
Thanks,
Rakshith
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can add your command up in a bash script along with a "sleep <n>" command, where <n> is a number of seconds.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried with below in the batch script but still facing same problem
@echo off
(curl -u username:password -d "@data.txt" -H "Content-Type: application/x-www-form-urlencoded" -k -X POST
"<base url>secure/admin/VerifyPopServerConnection!update.jspa"
Sleep 10 )> result.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hm, I think it would be better if we use the following options instead:
(from manpage)
--connect-timeout <seconds>
Maximum time in seconds that you allow the connection to the
server to take. This only limits the connection phase, once
curl has connected this option is of no more use. Since 7.32.0,
this option accepts decimal values, but the actual timeout will
decrease in accuracy as the specified timeout increases in deci‐
mal precision. See also the -m, --max-time option.
If this option is used several times, the last one will be used.
-m, --max-time <seconds>
Maximum time in seconds that you allow the whole operation to
take. This is useful for preventing your batch jobs from hang‐
ing for hours due to slow networks or links going down. Since
7.32.0, this option accepts decimal values, but the actual time‐
out will decrease in accuracy as the specified timeout increases
in decimal precision. See also the --connect-timeout option.
If this option is used several times, the last one will be used.
Check this out, it might help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried with -m option earlier but it was of no use.
--connect-timeout also didnt help much as once curl has connected this option is of no more use but we want the delay after curl has connected and before curl gets disconnected
Is there a way to make curl wait for few secs before it can wait before it fetches the result from the website?
All the options we used till now doesnt actually lengthen the execution time of only curl.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.