<UNKNOWN> value for host in snmptraps - snmp

while executing
"snmptrap -v 1 -c public localhost TRAP-TEST-MIB::demotraps localhost 4 0 '' IF-MIB::ifIndex i 1"
on my system,I am getting host ,ip & OID values as
host = localhost.localdomain :ip = UDP: [127.0.0.1]:49109->[127.0.0.1] :OID =DISMAN-EVENT-MIB::sysUpTimeInstance 0:3:12:38.28
But when traps are coming from outside its showing
host = :ip = UDP: [192.168.1.73]:52346->[192.168.1.23]:OID =DISMAN-EVENT-MIB::sysUpTimeInstance 7:1:05:54.27 .
Now its clearly shown above that host value didn't show up ...I want to know why & how it get to be resolve.
Thanks in advance

the one reason is if you are using VMware/virtual OS and you have not configured different IP than your host machine IP.

Simply keep ip & its corresponding host-name in /etc/hosts file..That's All
My /etc/hosts file is-
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.1.150 ZYXEL
192.168.1.73 CISCO
192.168.1.135 DIGISOL

Related

Pinging local host doesn't function

elasticsearch==7.10.0
I wish to ping local host '5601' to ensure kibana is running or not but apparently unable to ping.
Note: I am aware that elastic search has in-built function to ping but I still wish to ping using cmd line for a specific reason in my project.
C:\User>ping 5601
Pinging f00:b00:f00:b00 with 32 bytes of data:
PING: transmit failed. General failure.
PING: transmit failed. General failure.
PING: transmit failed. General failure.
PING: transmit failed. General failure.
Ping statistics for f00:b00:f00:b00:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)
C:\User>ping http://localhost:5601
Ping request could not find host http://localhost:5601. Please check the name and try again.
Could someone help me?
You can use netstat to check if the port exposed by the Kibana UI, 5061 is in LISTEN mode
$ netstat -tlpn | grep 5601
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp6 0 0 :::5601 :::* LISTEN -
Or if you want to establish a connection to destination port 5601 you can use nc
$ nc -vz localhost 5601
Connection to localhost 5601 port [tcp/*] succeeded!

`hostname -i` address differs from `ifconfig` address

Resolving my local hostname (the one returned by hostname) does not yield the right ip address. Why could that be and how do I fix it?
$ hostname -i
10.21.16.206
$ ping 10.21.16.206
PING 10.21.16.206 (10.21.16.206) 56(84) bytes of data.
From 10.21.16.159 icmp_seq=1 Destination Host Unreachable
$ ifconfig
(...)
inet 10.21.16.159 netmask 255.255.252.0 broadcast 10.21.19.255
(...)
10.21.16.206 != 10.21.16.159
$ host 10.21.16.159
Host 159.16.21.10.in-addr.arpa. not found: 3(NXDOMAIN)
$ host 10.21.16.206
206.16.21.10.in-addr.arpa domain name pointer lxka-czc1166cxw.united.domain.
$ resolveip 10.21.16.159
Host name of 10.21.16.159 is lxka-czc1166cxw
$ resolveip 10.21.16.206
Host name of 10.21.16.206 is lxka-czc1166cxw.united.domain
Help is very much appreciated!
Edit:
$ host $(hostname)
lxka-czc1166cxw.united.domain has address 10.21.16.206
hostname -i relies on DNS resolution to return the IP address of the given hostname. Either your /etc/hosts or dns resolver return that hostname to the incorrect IP address.
from man page of hostname:
option -i, --ip-address
Display the network address(es) of the host name. Note that this works only if the host name can be resolved. Avoid using this option;
use hostname --all-ip-addresses or
To use the hostname -I option instead of it.

Observium can't resolve host, but I can ping it

./add_device.php 1.2.3.4 catalyst v1
fails with
Try to add 1.2.3.4:
Could not resolve 1.2.3.4.
Devices failed: 1.
but ping works
fping 1.2.3.4
1.2.3.4. is alive
but snmpwalk works like:
snmpwalk -v 1 -c catalyst 1.2.3.4
iso.3.6.1.2.1.1.1.0 = STRING: "Cisco IOS Software, Catalyst...
...
web interface add device also fails same way.
what am I missing?
The community edition can't resolve IP's (go figure), so you have to create an entry in /etc/hosts for your IP and assign somename.whatever to it and then use that hostname and it will work.

Cannot access with IP from other devices, localhost server on MAC

I have set the default localhost server to run on my MAC with apache with the default settings. I can access the local server using localhost and the IP from the server it self but cannot access from another PC using the IP connected on the same WIFI network with a simple router.
I have disabled the firewall on mac but nothing.
This is my /etc/hosts file:
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
The mac IP on wifi is 192.168.10.102, the other PC IP is 192.168.10.105
Apache is set to listen on port 80, http.conf
Listen 80
sudo tcpdump -i en0 result:
15:35:28.384152 IP 192.168.10.105.63630 > 192.168.10.102.http: Flags [S], seq 2700046236, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
15:35:28.674606 IP 192.168.10.105.63631 > 192.168.10.102.http: Flags [S], seq 3459374519, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
15:35:29.335909 IP 192.168.10.102.51270 > 192.168.10.1.domain: 50623+ PTR? 103.10.168.192.in-addr.arpa. (45)
15:35:29.343300 IP 192.168.10.1.domain > 192.168.10.102.51270: 50623 NXDomain* 0/1/0 (95)
15:35:29.593550 IP 192.168.10.105.netbios-dgm > 192.168.10.255.netbios-dgm: NBT UDP PACKET(138)
15:35:30.345378 IP 192.168.10.102.58188 > 192.168.10.1.domain: 60091+ PTR? 255.10.168.192.in-addr.arpa. (45)
15:35:30.352597 IP 192.168.10.1.domain > 192.168.10.102.58188: 60091 NXDomain* 0/1/0 (95)
15:35:31.337113 ARP, Request who-has 192.168.10.102 tell 192.168.10.1, length 28
NOTE
While restarting the MAC computer for a couple of seconds I am able to access the localhost server with IP from the other computer...
Also the MAC has installed Symanctec End Point Protection which I cannot find a way to disable it even I have sudo permissions.
Any ideas?
After loosing almost 1 day and a half I found that Endpoint Security of Symantec blocked incomming connections. I came across this script that saved my days (disables service):
https://gist.github.com/phoob/671e65332c86682d5674
Also this is valid:
https://gist.github.com/bubenkoff/4043130
Hope helps some one other.

Xcode error: failed to launch [directory] -- invalid host string: 'localhost'

I am trying to run in command line tool the following code:
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
#autoreleasepool {
// insert code here...
NSLog(#"Hello, World!");
}
return 0;
}
and after "Build Succeeded" I am getting the following error:
error: failed to launch '/Users/dimitrisagagiotis/Library/Developer/Xcode/DerivedData/test-guvgymeaqzlsheascqbmllxdtpsn/Build/Products/Debug/test' -- invalid host string: 'localhost'
any solution??? Thank you
I had the same issue and resolved it with the following steps.
You have to verify that the following lines are included in the /etc/hosts file
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
Execute dscacheutil -flushcache to reload the DNS configuration
I have absolutely no idea how it was possible to get a host file without the loopback DNS entries to localhost. From this point of view, "invalid host string: 'localhost'" is pretty self-describing: localhost is a invalid host string to the system, it simply can not resolve localhost.
Xcode error Invalid string localhost
open terminal
//type
sudo nano /etc/hosts
// it may ask for password , enter the password;
// copy and paste this
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
then press control-o and then press enter and then press control-x
//then type
dscacheutil -flushcache
//use Xcode for c & c++ without internet !
In addition to checking that the correct lines are in the hosts file check that line endings are "Unix" and not some other kind of line ending. This solved the problem for me.

Resources