Collect MAC address of Zabbix agents - triggers

I would like to get the MAC address of the Zabbix agents (both Windows & Linux) and automatically fill in the inventory of the particular hosts.
I've used the key system.hw.macaddr to do this, but I think the key is only supported in Linux hosts. Still, the MAC address is not available in the inventory field of the Linux host.
What I need actually is to get the MAC address automatically when the host has registered and also to trigger an alert when any host tries to change the MAC address on their own.

Related

How to send parameters to daemon from client to server?

I am trying to create a kiosk client that stores its configuration on the server. Client is based on Raspberry Pi OS Lite (it runs on RevPi). Server is an Debian system. What I had in mind is following process:
boot kiosk (first boot with customized Raspberry Pi OS Lite)
kiosk will ask for server IP (maunual input)
kiosk will create ssh key at this moment
kiosk will ask server at given IP for registration (passing its MAC and generated key?)
? Server will receive request from kiosk with MAC and generated key.
server will create config file for that MAC address (copy from template) and do some more adminitrative tasks.
kiosk will reboot
after boot kiosk will check if his local config file is same as version on the server
if not: kiosk will download it AND reboot.
if yes: it will precess it and run... for ever till end of electricity.
I am done with cleaning up kiosk, I have installed what I need, all is configured as I wanted.
Now I am looking for an elegant solution to my only problem, atm:
How to send kiosks MAC address to server without any login ceremony. I thought of using a daemon on server side that listens at port for and messages with MAC address and ssh-keys but it have no idea how to
I used info from how to pass arguments to Linux daemon/service and my daemon is based on http://www.netzmafia.de/skripten/unix/linux-daemon-howto.html
Ok, after looking around I found spring-server. This is much more then I anticipated for! But all additional functionality offers more application possibilities! Thank You Bartobri.
With implementation of this answer I am good to go.

VMWare: Unable to access web server running on guest OS (Oracle Enterprise Linux 6.5) from host (Windows 7)

I am hosting a Oracle Linux 6.5 OS using VMWare on my windows 7 laptop. The VM is configured to use NAT networking configuration, and I am able to ping the guest OS successfully from my windows machine. Also, I am able to access internet from within my guest OS.
However, I am unable to access a web application running on port 8080 on a web server hosted within the guest OS using a browser in my host OS. The application is however accessible when accessed from a browser within the guest OS.
Some observations that may be of some use:
1. Neither my laptop, nor the VM have a static IP address.
2. I am able to ping my guest OS from host, and vice versa
3. Firewalls are disabled on both my laptop as well as the guest OS
Any help would be highly appreciated
The reason for the above issue could be mostly because of firewall settings/rules enabled in guest OS OEL. To check the rules you can type iptables -L -n at bash prompt which will display FILTER rules (CHAIN INPUT/OUTPUT/FORWARD).
Adding filters to allow the host to access guest http protocol would make things work. On the other hand, if this is for developmental purposes you can completely disable the firewall filter by saying
service iptables stop. Keep in mind that this is not a safe approach as it exposes your guest to the world without a firewall especially if you are using a bridged network connection.

VMWare fusion: connecting to host's web server from guest

I am a web developer and my development platform is Mac. I have installed a copy of Windows XP in VMWare fusion for testing purposes and using IE for previwing my websites. I have Apache running on my Mac with several subdomains, like test.localhost etc.
How can I access the webserver on host OS from the guest OS?
Thank you in advance.
Using Fusion 6.0.2 on OS X 10.9 Mavericks
In the host system (Mac)
turn off your virtual machine
open the "Virtual Machine | Network Adapter | Network Adapter Settings..." menu
in the "Bridget Networking" section choose "Autodetect":
turn on your virtual machine
In the guest system (Win7)
right click on the Notepad application, then select "Run as administrator":
when Win7 asks: "Do you want to allow the following program to make changes to this computer?"
click on the "Yes" button
navigate to: "Computer | Local disk (C:) | Windows | System32 | drivers | etc"
select "All files" in the drop down menu on the right of the "file name:" field
double click the "hosts" file
In the host system (Mac)
open your system preferences and select "Network"; in your connected interface look for the Mac IP:
192.168.1.106 in the example
In the guest system (Win7)
in your notepad window enter the Mac IP followed by the sites you want to reach in your host (Mac) system:
in the example I configured two sites: localhost and caeb.leo
open the browser and you will be able to see the sites hosted on your host system:
Hope it helps!
VMWare Fusion registers an IP address on your Mac and you can use this to point to the host from the virtual machine. You can find it with ifconfig vmnet8. Mine's 192.168.36.1, yours might be the same.
If you're using apache virtual hosts and you try to get http from this address on your virtual machine, it will probably display the default apache page. You'll need to map the domains on your windows host:
Open C:\WINDOWS\system32\drivers\etc\hosts in Notepad and add your hostnames, 1 per line:
192.168.36.1 test.localhost
Then, when you put http://test.localhost/ in IE, it will route to your Mac's apache virtual host.
Andrew's answer, while correct, is missing a significant portion, namely that vmnet8 is only used when the guest OS is set to use the Bridged network option.
If your guest OS is using the NAT network option, as seen in this Windows host example, you would need to use vmnet1 instead.
In this case, the IP of vmnet1 192.168.119.1 allows access to the host webserver, while the IP of vmnet8 leads nowhere.
note, I provide this answer for those who, like me, have the same question as the title but not the exact same specifics of running Apache as a raw local installation
double note, this answer is a mix of Andrew and Camaleo's answer since neither worked in my set up (not pointing to Mac's ip and Bridged Networking's "Autodetect" wasn't working for some reason?) , not sure if the inclusion of Docker Machine causes the hiccup
If you're setup is like so:
(Host) Mac (example ip 192.168.1.249)
(Guest) Docker Machine (example ip 192.168.99.102)
Apache (port 80)
VMware Fusion 10
(Guest) Windows 10 (example ip 192.168.68.142)
Step 1
From within Windows 10 VM open Notepad as Administrator (right click notepad for the option). Navigate to C:\Windows\System32\drivers\etc and instead of Text Documents(*.txt) select All Files. Open the hosts file and add a hosts entry for your Docker Machine's IP(via docker-machine ls). Per our above example setup, the line would look like so:
192.168.99.102 myapp.test # or some other fitting name
Save changes.
Step 2
Note: No need to stop or restart your virtual machine in VMware Fusion 10 when making network changes.
From VMware Fusion Menus select Virtual Machine / Network Adapter / Network Adapter Settings. Choose Share with my Mac.
if "Share with my Mac" is already selected, select a different network adapter option (like Bridged Network Automatic) and then re-select "Share with my Mac" to ensure host file changes are taken
Step 3
Test changes are in place from within Windows VM by pinging the desired address (e.g "myapp.test" as shown above) or by opening Edge/Chrome checking if the webpage loads
note, using a domain name that ends in .test is recommended or Chrome may still have issues with HSTS errors

Running a server in Parallels virtual machine. Is it possible for the host to access?

I am running a web server in my Windows 7 guest OS, while I want to access it from my Mac host OS.
The web server is running and I can access it from my guest OS, but not from its host.
I'm using Parallels Desktop and I've tried to change the networking mode from shared, bridged, to host-only with no result.
This is for development sake, so I just need it to be at least accessible to my host OS.
Is this actually possible with Parallels, or should I keep an eye on other VM engine?
You want to put your guest into "bridged" networking mode. This will allow it to obtain an IP address on the same network as your host OS (from your router via DHCP or statically configured).
See this:
Shared Networking – the recommended type of networking for the VM. Your virtual machine will share whatever network connection is used by
your Mac. You will be able to access the network from the VM as long
your Mac OS X is connected to the network. The only limitation of this
mode is that the VM is not visible from the external network
Bridged Networking – uses your network adapter. You should choose this mode if you want to access the VM from the external network.
Please keep in mind that your network configuration should allow using
DHCP to assign IP address for the VM, or you should obtain a static IP
for the VM and set it in the guest OS.

trouble accessing localhost from ie7 running on parallels (win xp) on mac os x

I'm running the app engine devserver on localhost:8080, and want to access it from ie7 running on parallels.
I've tried all of the tips here:
How Do I Access The Host Machine From The Guest Machine?
And they seem like they should work, particularly accessing via the gateway ip address. I've also
sudo ipfw add allow tcp from 8080 to 8089
for good measure. Still no dice. I can access the external internet from ie7. The connection settings on parallels are set to 'Shared networking'. I'm out of ideas.
You're not by any chance running it on localhost/127.0.0.1 on OS X and are trying to get at it using localhost/127.0.0.1 from XP?
If so, that's likely to be your problem - I would seriously doubt that the two instances of the OS share the loopback interface as that's specific to the OS.
I'd run it on OS X using the local IP and not localhost, then use the IP address to access it from XP. This should work if the XP box can see the host.