-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use check_mailbox with icinga2 #1
Comments
Hi aspryne First, download the newest version and save it under /etc/icinga2/scripts , get the script from https://raw.githubusercontent.com/ozzi-/check_mailbox/master/check_mailbox.sh Then edit /etc/icinga2/conf.d/commands.sh and add:
Now edit /etc/icinga2/conf.d/hosts.conf
Now edit /etc/icinga2/conf.d/services.conf
Now you will see performance data in the servide "mailboxserver imap".
let me know if you need any further info |
Thank you for all this information,
I still have some questions, the first is :
Why this configuration is necessary ? Its just to verify the server disponibility ?
object Host "my mailbox server" {
check_command = "ping4"
address = "192.168.1.10"
}
I replaced IP by my server name (Office365) : «outlook.office365.com » it’s correct ?
And my second question : The name « mailboxserver imap » must correspond to anything ?
apply Service "mailboxserver imap" {
check_command = "check-mailbox"
vars.chm_host = "imap://192.168.1.10:143"
vars.chm_credential = "username:password"
assign where host.name == "my mailbox server"
}
And at « imap://192.168.1.10:143 » I put « imap://outlook.office365.com:993 » are you agree with me ?
And for « username:password I just want to be sure i have to do « myEmailAccount:MyPassword » ?
I did that but I see Nothing on icingaweb2 =/ im sorry i just started on Icinga ^^
Thanks for your help, really
Provenance : Courrier<https://go.microsoft.com/fwlink/?LinkId=550986> pour Windows 10
…________________________________
De : ozzi- <notifications@github.com>
Envoyé : Tuesday, April 9, 2019 3:45:37 PM
À : ozzi-/check_mailbox
Cc : aspryne; Author
Objet : Re: [ozzi-/check_mailbox] How to use check_mailbox with icinga2 (#1)
Hi aspryne
First, download the newest version and save it under /etc/icinga2/scripts , get the script from https://raw.githubusercontent.com/ozzi-/check_mailbox/master/check_mailbox.sh
Then edit /etc/icinga2/conf.d/commands.sh and add:
object CheckCommand "check-mailbox" {
command = [ ConfigDir + "/scripts/check_mailbox.sh" ]
arguments += {
"-H" = "$chm_host$"
"-C" = "$chm_credential$"
"-M" = "INBOX"
"-w" = "1000"
"-c" = "2000"
}
}
Now edit /etc/icinga2/conf.d/hosts.conf
object Host "my mailbox server" {
check_command = "ping4"
address = "192.168.1.10"
}
Now edit /etc/icinga2/conf.d/services.conf
apply Service "mailboxserver imap" {
check_command = "check-mailbox"
vars.chm_host = "imap://192.168.1.10:143"
vars.chm_credential = "username:password"
assign where host.name == "my mailbox server"
}
Now you will see performance data in the servide "mailboxserver imap".
If you don't want to use a service (not recommended):
object Host "my mailbox server" {
check_command = "check-mailbox"
vars.chm_host = "imap://192.168.1.10:143"
vars.chm_credential = "username:password"
}
let me know if you need any further info
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://github.com/ozzi-/check_mailbox/issues/1#issuecomment-481258130>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AjPXuTH1g3Ce0ozhWcmhkrUyyY56g0y8ks5vfJmBgaJpZM4ckZR0>.
|
Concerning the connection string, check this for reference: Port 993 is correct but it requires TLS (transport encryption) so use imaps:// instead of imap:// (s stands for secure). Conerning your username, yes thats it. In order to see anything on icingaweb, reload the icinga service as such:
For further questions I suggest you go check https://community.icinga.com/ |
I still have an error or a « warning » when i do : icinga2 daemon -C
[2019-04-10 12:06:26 +0000] warning/ApplyRule: Apply rule 'check-mailbox' (in /etc/icinga2/zones.d/master/services.conf: 107:1-107:29) for type 'Service' does not match anywhere!
But thanks for your help i will try to Watch on the web
…________________________________
De : ozzi- <notifications@github.com>
Envoyé : Tuesday, April 9, 2019 7:52:36 PM
À : ozzi-/check_mailbox
Cc : aspryne; Author
Objet : Re: [ozzi-/check_mailbox] How to use check_mailbox with icinga2 (#1)
Why this configuration is necessary ? Its just to verify the server disponibility ?
Yes, as this is common practise. Otherwise use this directly:
object Host "my mailbox server" {
check_command = "check-mailbox"
vars.chm_host = "imap://192.168.1.10:143"
vars.chm_credential = "username:password"
}
Concerning the connection string, check this for reference:
https://support.office.com/en-us/article/pop-and-imap-email-settings-for-outlook-8361e398-8af4-4e97-b147-6c6c4ac95353
Port 993 is correct but it requires TLS (transport encryption) so use imaps:// instead of imap:// (s stands for secure).
Conerning your username, yes thats it.
In order to see anything on icingaweb, reload the icinga service as such:
sudo service icinga2 restart
For further questions I suggest you go check https://community.icinga.com/
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://github.com/ozzi-/check_mailbox/issues/1#issuecomment-481362406>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AjPXueX6p1GHNXp-Ace_io_nWvLNLxxZks5vfNNkgaJpZM4ckZR0>.
|
Hi What does your service.conf say?
|
I got this in Service.conf
apply Service "check-mailbox" {
check_command = "check-mailbox"
vars.chm_host = "imaps://outlook.office365.com:993"
vars.chm_credential = "user:mdp"
assign where host.name == "my mailbox server"
}
Host.conf :
object Host "my mailbox server" {
check_command = "ping4"
address = "outlook.office365.com"
}
Command.conf :
object CheckCommand "check-mailbox" {
command = [ ConfigDir + "/scripts/check_mailbox.sh" ]
arguments += {
"-H" = "$chm_host$"
"-C" = "$chm_credential$"
"-M" = "INBOX"
"-w" = "1000"
"-c" = "2000"
}
}
Provenance : Courrier<https://go.microsoft.com/fwlink/?LinkId=550986> pour Windows 10
…________________________________
De : ozzi- <notifications@github.com>
Envoyé : Thursday, April 11, 2019 8:53:33 AM
À : ozzi-/check_mailbox
Cc : aspryne; Author
Objet : Re: [ozzi-/check_mailbox] How to use check_mailbox with icinga2 (#1)
Hi
What does your service.conf say?
assign where host.name == "REPLACE THIS WITH the hostname"
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://github.com/ozzi-/check_mailbox/issues/1#issuecomment-481989769>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AjPXudMD5WXSs4SKHIs1Frt68vSDFNBFks5vftvtgaJpZM4ckZR0>.
|
The config provided above works for me. Try putting all together into one conf file. |
Really ? im so unlucky =/
Icinga can read and understand everything in only one file ?
Can you just tell me where i have to create the file and if there is any « covention » for the name.
thanks
…________________________________
De : ozzi- <notifications@github.com>
Envoyé : Thursday, April 11, 2019 10:17:21 AM
À : ozzi-/check_mailbox
Cc : aspryne; Author
Objet : Re: [ozzi-/check_mailbox] How to use check_mailbox with icinga2 (#1)
The config provided above works for me. Try putting all together into one conf file.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://github.com/ozzi-/check_mailbox/issues/1#issuecomment-482016126>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AjPXuamdKOfW0F4oypWLKSe3oGru5oOGks5vfu-RgaJpZM4ckZR0>.
|
Don't worry, we / you will figure it out ;) Icinga , per defaults, reads all *.conf files in the folder conf.d. Go check /etc/icinga2/icinga2.conf. The last line says:
Icinga does not care if you mix hosts and services etc. its just for keeping everything tidy. This is working for me (I added '2' to the service name as i have defined it somewhere else already):
You can try:
This will assign the service to all hosts that have a name. |
Further reading, a blog post of mine: |
Ok we forward !! in my icinga.conf file the line « include_rescursive » was commented so she was desactivate … that why i didn’t see this new service. (i used an external directory « /etc/icinga2/zone.d/master/service.conf).
So now i can see the check_mail service but the access is denied :
[cid:image001.png@01D4F076.DFF92000]
So i used chmod and chown but no change :
[cid:image002.png@01D4F076.FB399890]
And :
[cid:image003.png@01D4F077.1C0A5280]
Do you have an idea ?
Thank you so much,
De : ozzi-<mailto:notifications@github.com>
Envoyé le :jeudi 11 avril 2019 13:30
À : ozzi-/check_mailbox<mailto:check_mailbox@noreply.github.com>
Cc : aspryne<mailto:louis21110@hotmail.fr>; Author<mailto:author@noreply.github.com>
Objet :Re: [ozzi-/check_mailbox] How to use check_mailbox with icinga2 (#1)
Further reading, a blog post of mine:
https://zgheb.com/i?v=blog&pl=41#ic_configuration
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://github.com/ozzi-/check_mailbox/issues/1#issuecomment-482077270>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AjPXuQLvmy_8pe8pY5OV1zyBPmiwodJtks5vfxzdgaJpZM4ckZR0>.
|
Hi aspryne |
So your "ConfigDir" points to /usr/lib64/nagios/plugins? Interesting. |
You was right ! SeLINUX was the problem i already had a problem with selinux during icinga’s installation and i disabled it. But its was tempory ! i had to do it one more time now its works !
Thank you so much ! i learn lot of thing about icinga2 with you thanks
Provenance : Courrier<https://go.microsoft.com/fwlink/?LinkId=550986> pour Windows 10
…________________________________
De : ozzi- <notifications@github.com>
Envoyé : Friday, April 12, 2019 11:37:48 AM
À : ozzi-/check_mailbox
Cc : aspryne; Author
Objet : Re: [ozzi-/check_mailbox] How to use check_mailbox with icinga2 (#1)
So your "ConfigDir" points to /usr/lib64/nagios/plugins? Interesting.
Permissions look ok, group all has read + execute.
Are you running SELinux? Never seen this problem.
This is beyond what I can help you with. Please go to icinga communtiy for any further help
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://github.com/ozzi-/check_mailbox/issues/1#issuecomment-482509114>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AjPXuf5YdJx2E7pfHX546aPNExPlOXBAks5vgFPsgaJpZM4ckZR0>.
|
cool we got it running! |
changed bc scale from 10 to 0 to get back integer
Hi,
I have a stupid problem, but i don't understand how can I use this script with icingaweb2.
I juste want to watch the total number of my mail from my mailbox on icigaweb2.
i just have to modify command.conf ? or service.conf too ? or anything else.
thanks for your help
The text was updated successfully, but these errors were encountered: