create zabbix trigger configuration - zabbix

i have 2 remote sites routers
using Zabbix for monitoring
i need to make a trigger as below
first :check 2 sites though SNMP
second : if 2 sites down don't send notification
third: if one site up and other down >> send notification with down site
please help for critical case
get solution through zabbix or any script language

Related

How to fix wordpress login attempts. I have deleted wp-login.php, and still getting attempts?

Check list of Items I have done:-
added new salts (better security pro paid plugin = max'd out security)
brute force attack is on and has not stopped all attempts.
changed login (simple wp login plugin)
monitor file change (simple history plugin)
monitor live actions (wordfence plugin)
deleted wp-login.php (add using ftp program when I want to login)
deleted admin.php (didn't make a difference still get login attempts)
changed the nickname and deleted old user so public see fake name
There must be another way these login attempts ares still coming in
I just delete the ajax login from the admin folder
Is this a plugin exploit?
Is it possible to be a database attack?
How would I monitor the mysql?
There's really nothing you can do to prevent someone from sending HTTP requests to your server, which is what is most likely going on. I assume that you are seeing these login requests in your log files?
My suggestion would be to deploy a web application firewall of some kind, which is independent of WordPress and is designed to integrate with Apache or Nginx, such as ModSecurity which is OpenSource. This will at least give you some more options at the web application layer.

Gnome 3 automatic execution of a script that needs network

my old father is using ubuntu-gnome. He has no static ip address. In order to perform remote administration, I need to know his ip. I was using dyndns free account (configuration in the adsl modem), but this will stop working in a couple of days.
I would like to run a script each time he logs in to publish his ip on my website. I have tried to put a script on the boot, but the network is not available. It seems that it is gnome 3 that starts the network, but I do not know much about gnome 3.
How should I do to have my script run automatically as soon as the network is available ?
One possible non-elegant solution for this is to put your script in his cron to run every X minutes :)
Looking to mine /etc/NetworkManager/ looks like there is a folder dispatcher.d that I think it'll do what you want. Just experiment with a bash/perl/python w/e script in there set the permission appropriately. You can find the UUID in the system-connections/ folder. More information is available in man networkmanager.
EDIT: Look what I found: https://askubuntu.com/questions/13963/call-script-after-connecting-to-a-wireless-network. Seems like this is exactly what you want.
The easiest way is to use another dynamic DNS service. I used to use my own. You could also put curl or wget command to cron or create a systemd service that will call that command periodically. As a target you would have to use your machine with a web server where you can see the IP in your logs.
It is not Gnome that connects the network, it is a system service called NetworkManager. It tries to connect at boot if possible. In some cases it waits for wireless signal, in other cases it waits for a user password. I recently verified that in Fedora, NetworkManager properly implements the systemd's network-online.target but it may have yet to be fixed in other distributions, see the upstream bug report.
https://bugzilla.gnome.org/show_bug.cgi?id=728965
If you want to run a system service just after boot, you need to use:
[Unit]
...
Wants=network-online.target
After=network-online.target
You could also just run a script that calls nm-online at the beginning to wait for the network connectivity if you can expect the connectivity to come up in reasonable time, otherwise it times out. Such a script can be run from any environment including a user session.
And, as noted already, you can put a script into /etc/NetworkManager/dispatcher.d that will be called on any network configuration change and such a script can then filter connection up events and start the notification script.

Drupal 7, SMTP module + Gmail

Gmail blocks any suspicious activity, and kudos to them for that. An example of this is when you're configuring your SMTP module to use your gmail account for sending mail from your drupal 7 + SMTP module-enabled site. How do I enable gmail to accept mail from my Drupal site?
Here are the steps I use to allow Drupal + SMTP access to my gmail's SMTP server:
Note: disabling the "overlay" module may help with reading the output generated in step #6; so consider disabling it.
Install and configure the SMTP module for drupal. Configure for your gmail account. Instructions here
Prepare gmail to "watch" for new application access to your account.
Ensure that you've logged in to gmail using the same account with which you wish to associate your Drupal site
Visit https://accounts.google.com/DisplayUnlockCaptcha
You will be see instructions about how to enable another application to send on your behalf. You have 10 minutes after clicking [ continue ] to complete the next step.
The last field at admin/config/system/smtp is "SEND TEST E-MAIL" which doubles as an excellent SMTP debugger, btw. Enter your email address here and check enable debuging just below the field.
Click [ Save Configuration ] this will trigger the sending of the test email.
Watch the debugging output produced by SMTP, which the SMTP module places visually towards the top of the SMTP configuration page.
If you see send errors, review the output for corrective actions.
Hope this helps.

Triggering a hudson job by e-mail

For the life of me i cannot get this to work. I've spent almost 4 hours on this and it just does not work. I would like to start hudson job when an e-mail is sent to a specific user. I looked and followed the info mentionned here: http://wiki.hudson-ci.org/display/HUDSON/Building+a+software+project
but still cannot get it to work.
Here is a summary of what i've done so far:
Modified /etc/aliases such that any email going to usr1 trigger the build as in
usr1: "|wget http://hudson-server/hudson/job/myjob/build"
I reconstructed the aliases db after making the above changes and sent out an e-mail to usr1 but nothing happened.
Our emails run on an exchange server. My hudson server sits on a linux box. I tried to use sendmail to do my testing and cannot get it to work. All of the above changes are done on linux. So i'm not sure if the issue here is with sendmail/exchange server or is something i'm missing.
Has anyone got this to work?
I appreciate your help here guys.
Britney
A couple of things to check:
Make sure that running wget http://hudson-server/hudson/job/myjob/build from the command line successfully starts a build. You may have problems if you have security on the server (or the job).
Make sure your exchange server is forwarding the mail for the email address in question to the mail server running on your linux box. If the mail isn't being received there, the wget command in aliases won't ever get executed.
How are you sending the email to usr1? Are you sending it from the same Linux box where the /etc/aliases is located?
To test your setup, on your Linux machine, send your email like this:
mail -s "test email to usr1" usr1#localhost
If the hudson job got executed, then your /etc/aliases setup works.
I suspect your problem could be your Linux box cannot receive emails. See if this works first before you setup the redirection in /etc/aliases. To check for incoming emails, login as usr1 and run mail at the shell prompt.

Plesk, SMTP and sending e-mail from same domain

I have a server with Plesk installed.
On that I've created a domain, my-domain.com, and added and e-mail account noreply#my-domain.com with access to SMTP for sending e-mails.
With PHPMailer or Swift Mailer I am able to send via the SMTP account noreply#my-domain.com whenever the from address is outside the my-domain.com, for example info#my-second-domain.com.
Whenever I'm using an e-mail address that ends on #my-domain.com it fails.
I've tried to look in the /usr/local/psa/var/log/maillog file, but it only stores the mails that doesn't fail.
Can someone help me figure out where the problems is?
You can try this:
Delete the related domain in the qmail file /var/qmail/control/virtualdomains
Then reload/restart qmail. Now it should work.
More technical background at http://forum.parallels.com/pda/index.php/t-93222.html
Benjamin answer didn't work on my installation (Plesk 11.5), but I found another solution:
just turn off the mail service itself. It might not be the solution for everyone but it was for me (my domain's mx records pointing to another server, with some scripts sending emails here and there).
You can turn off the mail service fairly easily using Plesk GUI.
Then uncheck
However, this won't turn it off for subdomains and secondary domains you might have. No problem, just log in with ssh and run this command:
/usr/local/psa/bin/domain -u mydomain.example.com -mail_service false
And if one day you decide you want to turn it back on just replace false by true.