Tried to use monfile to add info about machines automagically.
(BTW, in monequip.example.sh the last line probably should have ">>" ;-))
And program grubs MAC address from monfile properly... but only first one.
Nowadays servers usually have more than one NIC, wouldn't you agree?
And it would be nice if program uses all info from monfile. What do you think?
Thanks,
Michael
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I already thought about parsing more information out of the monfiles but did not find time to code that yet, so at the moment only network information (interface name, IP and MAC) and the machine's architecture are understood.
However, phpEquiMon should very well be able to read multiple IPs/MACs from a monfile and show them at least on the "Consistency Check" page and the list page (main "index") in both the sysinfo tooltip and the monfile-column, if added.
Can you provide a sample monfile where this does not work?
Best regards
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No, it does not take more than MAC address of first interface.
And on index page it actually saying in tooltip "No DHCP/monfiles data available" (?)
Below is a sample monfile with name = hostname and placed in directory, specified in Admin Panel:
(sorry, I changed actual numbers to bogus ones, you understand)
----------------------------------------------------------
Linux somename 2.4.20-28.7smp #1 SMP Thu Dec 18 11:18:31 EST 2003 i686 unknown
eth0 Link encap:Ethernet HWaddr 00:11:22:33:44:55
inet addr:XXX.XXX.XXX.XXX Bcast:XXX.XXX.XXX.XXX Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:140235886 errors:0 dropped:0 overruns:0 frame:0
TX packets:209064921 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1895318497 (1807.5 Mb) TX bytes:2962891095 (2825.6 Mb)
Interrupt:29 Base address:0x2600 Memory:fbfe0000-fc000000
okay, let's chase down this error (it works for me with exactly your monfile and is showing eth1 and eth2- eth0 is hidden because phpEquiMon considers the IP to be "bogus" ;-) ).
Do you have a slash at the end of your monfiles directory in the config?
It is important that you have the cronjob working because that is the part of phpEquiMon that reads the monfiles... I cannot parse all 100 monfiles if you are just viewing the index page with 100 machines on it every time.
If your cronjob is running please try running it by hand on the command line (as root or webserver user) and see if it gives any output (if you are running it as a cronjob, it is possible that you are already getting this output via mail, depending on your crond's settings). If it does not, try inserting an echo "test" in helper.php, line 488, after the opening bracket, to see whether the monfile is at least found.
Are you sure the monfile is readable for the user running the cronjob?
The IPs are not correctly extracted which is another problem with the parser (I'm relying on a certain ifconfig output and your ifconfig seems to give a slightly altered output, I'll investigate that).
Best regards,
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, running cron job produced right entries on Index page and on Consistency check page, IPs(!) and MACs for both interfaces.
Let me explain, where my initial confusion came from.
I agree, you probably shouldn't parse monfiles while user is viewing Index page,
but when I was filling up "Add Entry" form, I saw comment for "MAC Address" field: "Leave empty to automatically fill in data from the monfile if existing.", so I assumed that if I leave it empty and will have monfile for that machine, then after I'm done and push "Add & return" button, program will check whether monfile exist for machine I specified hostname for, and if yes, will grab information from it. Does it sound logical thing to assume? Another thing, which makes me believe that this is a way program will work, is the fact, that I can't enter more than one IP or MAC address from "Add Entry" form. And third fact was: initially I didn't enter MAC address at all, but when I finished with "Add Entry" form, the first MAC was there, in database I mean. That's how this thread got started...
By the way, this scheme produces a little bit confusing (again - for me ;-)) table in "Consistency check" page. So I have one MAC address in "MAC in database" column, and two MAC adddresses in "MAC from monfile" column. There no marked red entries, and yet one MAC is missing in database. You see what I'm confused about? ;-)
Regards,
Michael
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yes, I see the problem and I completely agree with you. phpEquiMon should have a way to support unlimited network interfaces for a machine (each consisting of a name, an IP, a MAC and the connectivity status being automatically determined by the ping sweep).
This does not really fit with the current database layout but since I am planning changes anyway, I should add this. Internally this would mean a new table that contains one record for each interface each.
Thanks for your suggestions!
Best regards
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Chris,
Tried to use monfile to add info about machines automagically.
(BTW, in monequip.example.sh the last line probably should have ">>" ;-))
And program grubs MAC address from monfile properly... but only first one.
Nowadays servers usually have more than one NIC, wouldn't you agree?
And it would be nice if program uses all info from monfile. What do you think?
Thanks,
Michael
Hi Michael,
I already thought about parsing more information out of the monfiles but did not find time to code that yet, so at the moment only network information (interface name, IP and MAC) and the machine's architecture are understood.
However, phpEquiMon should very well be able to read multiple IPs/MACs from a monfile and show them at least on the "Consistency Check" page and the list page (main "index") in both the sysinfo tooltip and the monfile-column, if added.
Can you provide a sample monfile where this does not work?
Best regards
Chris
Chris,
No, it does not take more than MAC address of first interface.
And on index page it actually saying in tooltip "No DHCP/monfiles data available" (?)
Below is a sample monfile with name = hostname and placed in directory, specified in Admin Panel:
(sorry, I changed actual numbers to bogus ones, you understand)
----------------------------------------------------------
Linux somename 2.4.20-28.7smp #1 SMP Thu Dec 18 11:18:31 EST 2003 i686 unknown
eth0 Link encap:Ethernet HWaddr 00:11:22:33:44:55
inet addr:XXX.XXX.XXX.XXX Bcast:XXX.XXX.XXX.XXX Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:140235886 errors:0 dropped:0 overruns:0 frame:0
TX packets:209064921 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1895318497 (1807.5 Mb) TX bytes:2962891095 (2825.6 Mb)
Interrupt:29 Base address:0x2600 Memory:fbfe0000-fc000000
eth1 Link encap:Ethernet HWaddr 00:11:22:33:44:66
inet addr:10.10.10.10 Bcast:10.10.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1961847091 errors:0 dropped:0 overruns:0 frame:0
TX packets:2028666780 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:3354500374 (3199.1 Mb) TX bytes:2431144131 (2318.5 Mb)
Interrupt:30 Base address:0x2640 Memory:fbfc0000-fbfe0000
eth2 Link encap:Ethernet HWaddr 00:11:22:33:33:77
inet addr:10.20.20.20 Bcast:10.20.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16002032 errors:0 dropped:0 overruns:0 frame:0
TX packets:8900836 errors:0 dropped:0 overruns:0 carrier:92
collisions:5183439 txqueuelen:100
RX bytes:2322393394 (2214.8 Mb) TX bytes:715777802 (682.6 Mb)
Interrupt:24 Base address:0x3000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:366230613 errors:0 dropped:0 overruns:0 frame:0
TX packets:366230613 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:22748475 (21.6 Mb) TX bytes:22748475 (21.6 Mb)
-----------------------------------
Thanks,
Michael
Hello Michael,
okay, let's chase down this error (it works for me with exactly your monfile and is showing eth1 and eth2- eth0 is hidden because phpEquiMon considers the IP to be "bogus" ;-) ).
Do you have a slash at the end of your monfiles directory in the config?
It is important that you have the cronjob working because that is the part of phpEquiMon that reads the monfiles... I cannot parse all 100 monfiles if you are just viewing the index page with 100 machines on it every time.
If your cronjob is running please try running it by hand on the command line (as root or webserver user) and see if it gives any output (if you are running it as a cronjob, it is possible that you are already getting this output via mail, depending on your crond's settings). If it does not, try inserting an echo "test" in helper.php, line 488, after the opening bracket, to see whether the monfile is at least found.
Are you sure the monfile is readable for the user running the cronjob?
The IPs are not correctly extracted which is another problem with the parser (I'm relying on a certain ifconfig output and your ifconfig seems to give a slightly altered output, I'll investigate that).
Best regards,
Chris
Hi Chris,
Yes, running cron job produced right entries on Index page and on Consistency check page, IPs(!) and MACs for both interfaces.
Let me explain, where my initial confusion came from.
I agree, you probably shouldn't parse monfiles while user is viewing Index page,
but when I was filling up "Add Entry" form, I saw comment for "MAC Address" field: "Leave empty to automatically fill in data from the monfile if existing.", so I assumed that if I leave it empty and will have monfile for that machine, then after I'm done and push "Add & return" button, program will check whether monfile exist for machine I specified hostname for, and if yes, will grab information from it. Does it sound logical thing to assume? Another thing, which makes me believe that this is a way program will work, is the fact, that I can't enter more than one IP or MAC address from "Add Entry" form. And third fact was: initially I didn't enter MAC address at all, but when I finished with "Add Entry" form, the first MAC was there, in database I mean. That's how this thread got started...
By the way, this scheme produces a little bit confusing (again - for me ;-)) table in "Consistency check" page. So I have one MAC address in "MAC in database" column, and two MAC adddresses in "MAC from monfile" column. There no marked red entries, and yet one MAC is missing in database. You see what I'm confused about? ;-)
Regards,
Michael
Hello Michael,
yes, I see the problem and I completely agree with you. phpEquiMon should have a way to support unlimited network interfaces for a machine (each consisting of a name, an IP, a MAC and the connectivity status being automatically determined by the ping sweep).
This does not really fit with the current database layout but since I am planning changes anyway, I should add this. Internally this would mean a new table that contains one record for each interface each.
Thanks for your suggestions!
Best regards
Chris